09-25-2016, 10:47 PM
You're close. From your post on 9/20, you can't have bare logic like an `if` out in the open in a source file. Acquiring the suites inside a function like Plugin:tartup() is the only way (like your post on 9/21).
My suggestion is to create a separate header, like you've done, to include all the necessary SDK files and declare the associated suite globals. Then, make this header file a "prefix header" in your Xcode project settings (same thing in Visual Studio on Windows once you're at that point).
Also in your Xcode project settings, add the "HDI_CORE_DONT_DECLARE_AI_TYPES" preprocessor definition to prevent CORE from declaring the various Illustrator SDK types it needs to operate (since you're including [some of] them yourself manually). Our Skeleton project already sets some preprocessor defs like "MAC_ENV" so you can just follow by example.
Lastly, don't forget to set your suite globals to `NULL` in some source file (which you can't do when you declare them with extern in your header).
My suggestion is to create a separate header, like you've done, to include all the necessary SDK files and declare the associated suite globals. Then, make this header file a "prefix header" in your Xcode project settings (same thing in Visual Studio on Windows once you're at that point).
Also in your Xcode project settings, add the "HDI_CORE_DONT_DECLARE_AI_TYPES" preprocessor definition to prevent CORE from declaring the various Illustrator SDK types it needs to operate (since you're including [some of] them yourself manually). Our Skeleton project already sets some preprocessor defs like "MAC_ENV" so you can just follow by example.
Lastly, don't forget to set your suite globals to `NULL` in some source file (which you can't do when you declare them with extern in your header).