Ok, so I finally got the HelloWorld example from the docs to compile. However, when I start illustrator the "Hello World" dialog does not appear. The PlugIn is listed in the Help > System Info... dialog, and when illustrator shutsdown, the "Goodbye World" dialog does appear.
At least I got the project to compile and load into AI so I can start playing around with it, but does anyone know why the 1st dialog isn't displaying? All the code used was directly from the getting started document with no modifications.
OK, on to debugging. When I start debugging, I get the following warning:
If I click yes, the debugging seems to work, though I get an error when I try to step out of my plugin and into illustrator, which I assume is normal. Is this anything I should be concerned about or can I just ignore this dialog from now on? Also, is there a setting somewhere to ignore the error when I acidentally step back into AI? I'm sure I'm going to be doing that alot and it would be nice to have Visual Studio just ignore me at those times.
I appreciate the help guys, it's been a chore getting this far, but I feel like I've just passed a milestone.
Yeah, you can check that "Don't show again" -- its basically just saying "I can't debug the target you picked!", which is kind of of obvious. It shouldn't give you an error so much as a warning when you step into Illustrator code, but that's probably what you mean.
As for the Hello World thing -- are you just popping up your own dialog, or was that an ADM dialog? If the former, its probably always there and just behind the application because the parent is incorrect -- getting the proper parent for Illustrator is a wonderful journey, full of strong curse words and new & colourful phrases!
Looks like it's using ADM. Here's the code from the getting started guide:
extern "C" ASAPI ASErr PluginMain(char* caller, char* selector, void* message)
ASErr error = kNoErr;
SPBasicSuite* sSPBasic = ((SPMessageData*)message)->basic;
ADMBasicSuite11 *sADMBasic = nil;
error = sSPBasic->AcquireSuite(kADMBasicSuite,
error = sSPBasic->ReleaseSuite(kADMBasicSuite,kADMBasicSuiteVersion11);
Stepping through the code, I can see that the MessageAlert method is reached and called, but nothing seems to happen in AI.
Odd then. That should pop up 'Hello World' when its starts up & 'Goodbye World!' when it shuts down, as I'm sure is obvious. Well, popping dialogs at those points isn't somethind I'd do personally -- if I wanted to show the user a dialog I'd wait until I got the 'application started' notifier, which is a lot farther along in the load time. So I wouldn't worry about that too much.
Make sure your suites are getting registered correctly. What's sADMBasic set to when you hit that point?
Edit: Is that the code from the sample project? Or have you modified where that dialog is popped?
Message was edited by: btemp
sADMBasic is set to ADMBasicSuite11* at that point.
My goal with this plugin is just to start learning how the SDK is structured, so this little issue isn't really that important. If I was ever to need a dialog on startup, I would likely go with the notification as A. Patterson suggested. I was just surprised that it did not pop up an alert because the code is all out of the Getting Started document and I thought that maybe I had something configured incorrectly in Visual Studio. Maybe the docs are just not as reliable as I assumed. Eg. I can't seem to locate any information at all on kSPInterfaceCaller in the HTML reference. It talks about it in the getting started doc, but that's it.
Thanks for the help guys.
The Selectors & Callers are just glorified "action" notifiers. They could have made it one big enum list, but they broke it into classes so the code would look be more readable (which is good!). kSPInterfaceCaller just contains sub-actions like startup, shutdown & 'about'. The other callers (menu, annotation, tools, notify, etc.) are more interesting from a 'doing stuff' point of view
I was asking more about whether sADMBasic is pointing to valid data at that point. Its possible the suites haven't been loaded at that time, or that there is some issue with how they are being loaded. Did you check the value of 'error' there?