Skip to main content
Inspiring
October 26, 2025
Question

How do you create global variables in a C++ plugin?

  • October 26, 2025
  • 1 reply
  • 79 views

How do you create global variables in a C++ plugin?

1 reply

Community Expert
November 19, 2025

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

  • Add non persistent interface to boss classes like session, workspace. Set and get them as per your needs
  • Using IBlackBoxCommands which can store key/value pairs

Outside InDesign SDK

  • Something like a singleton class which is set/get as needed and accessible in any code file

-Manan

-Manan