Object lifecycle in FileMaker process

View: New views
2 Messages — Rating Filter:   Alert me  

Object lifecycle in FileMaker process

by julian_salerno :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

When our (C++) plugins are loaded as dynamic libraries by FileMaker,
it would appear (from my own debugging) that a new instance of the
entry-point object (ie. a new instance of 'MyPlugin' class) is created.

I ask this question from the perspective of disabling and then
re-enabling the plugin.

In my case there is a need to store some state in the plugin (or even
in a class which the plugin uses). I have tried to introduce a static
variable, but the variables state is not as I expect it to be after a
plugin is re-enabled following a disable (indicating a whole new
instance of the plugin was loaded).

Can anybody confirm this and/or maybe suggest a solution, alternative
or workaround when trying to store state across enabled/disabled
plugin states ?

J


Re: Object lifecycle in FileMaker process

by Jake Traynham :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Save your state to the hard drive on shutdown and reload on init?

Jake

julian_salerno wrote:

>
>
> When our (C++) plugins are loaded as dynamic libraries by FileMaker,
> it would appear (from my own debugging) that a new instance of the
> entry-point object (ie. a new instance of 'MyPlugin' class) is created.
>
> I ask this question from the perspective of disabling and then
> re-enabling the plugin.
>
> In my case there is a need to store some state in the plugin (or even
> in a class which the plugin uses). I have tried to introduce a static
> variable, but the variables state is not as I expect it to be after a
> plugin is re-enabled following a disable (indicating a whole new
> instance of the plugin was loaded).
>
> Can anybody confirm this and/or maybe suggest a solution, alternative
> or workaround when trying to store state across enabled/disabled
> plugin states ?
>
> J
>
>

--
Jake Traynham
Owner, CNS Plug-ins
http://www.cnsplug-ins.com/
LightInTheBox - Buy quality products at wholesale price!