Single instance of addin(powerpoint

A

Amit D

Hi ,
i just had a strange problem .We are trying to develop a powerpoint
addin.
Adding has 2-3 forms.the addin adds two buttons to the menu bar too.
we are using shared addin (VS2005) to target multiple office versions.

But the design of the addin is such that we need only one instance of
the addin running at the given time..
we want to disable some functions of addin if more than one instance
is created.

eg: we want something like this....
In OnConnection function ... or may be on menubar item click

if(instance_created==false){
add_to_menu_bar( );
initForms( )
instance_created=true;
}

else{
messagebox.show("you cannot open second instance of addin.");

}

i don't know how to manipulate "instance_created" flag with mutiple
instances of addin and office.
ie:how to detect already running addin instance..
i have seen many single instance application examples on codeproject
and google but dunno if they will work in addin environment.

Please try to help.

thx
amit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top