Copy link to clipboard
Copied
How do you create global variables in a C++ plugin?
Multiple ways I suppose. I am stating generically as I don't know your specific context/usecase
Staying within the InDesign SDK constructs you can use the following
Using IBlackBoxCommands which can store key/value pairs
Outside InDesign SDK
-Manan
Copy link to clipboard
Copied
Multiple ways I suppose. I am stating generically as I don't know your specific context/usecase
Staying within the InDesign SDK constructs you can use the following
Using IBlackBoxCommands which can store key/value pairs
Outside InDesign SDK
-Manan
Copy link to clipboard
Copied
>>Add non persistent interface to boss classes like session, workspace. Set and get them as per your needs
// .fr
resource ImplementationAlias(1)
{
{
kMyIntDataImpl, kIntDataImpl,
}
};
resource ClassDescriptionTable(kMyClassDescriptionTableResourceID)
{{{
AddIn
{
kSessionBoss,
kInvalidClass,
{
IID_IMYINTDATA, kMyIntDataImpl,
}
},
}}};
// .cpp
InterfacePtr<IIntData> iIntData(::GetExecutionContextSession(), IID_IMYINTDATA);That's how it went, and this method worked out well.
Adding class variables also requires a header, but it worked out fine.
For example, I've added class variables to the script provider and am using them.
Copy link to clipboard
Copied
Great news. Look into the IBlackBoxCommands as well. The good thing about this is that you are saved the work to add things in the fr. You can straightaway use them in the cpp files
-Manan
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more