The answer to this may be an obvious one, but I can't seem to work it out.
I'm using an ifstream to open an xml file in my plugin. To get it to work, for the time being, I've passed the absolute path of the xml to the ifstream when opening it.
What I really want to be able to do is distribute the xml file, so an absolute path is obviously a no go. Now, when I run the aip in debug (I've got illustrator as my start up program in Visual Studio), the working directory is the location of my visual studio solution. If I start illustrator normally, the working directory is the location of the illustrator exe. So what I want to be able to do is pass a path relative to the aip that's currently loaded. Is this possible?
Is there an easy way of getting hold of the aip directory? Or setting the working directory to be that?
Preferably I would like a cross platform solution, as I would like to be able to deploy this on Mac OS with as few tweaks to the code as possible.
Many thanks in advance
You can use AIFoldersSuite::FindFolder with folder type of kAIPluginsFolderType to get the plugins folder.
I package a text data file with the resources in my aip file. That might be helpful for you.