Hello Guest it is November 27, 2021, 10:16:56 AM

Author Topic: Trouble saving plugin cfg from Plugins Control menu  (Read 2067 times)

0 Members and 1 Guest are viewing this topic.

Trouble saving plugin cfg from Plugins Control menu
« on: December 23, 2011, 06:04:28 PM »
I'm trying to move a plug-in configuration menu from the Config->Config Pllugins method to installing a "config" menu entry under the "Plugins Control" menu.  I can get my config dialog to display but it never seems to save the changes into the XML file.  I have my code set up to display the plug-in configuration from two places: the origiinal "Config->Config Plugins" dialog by clicking the "CONFIG" button next to my plug in, and the menu entry that I created under the "Plugin Control" menu.  They both call the same routine to display the dialog and update the XML file.

Here is the code from myNotify() which uses the same code to create the DevProf instance that MachDevice.cpp Config() uses.
Code: [Select]
if ( message == MenuRangeStart ) {
   //---  Copied from MachDevice.cpp Config()  ---//
   CXMLProfile *DevProf = new  CXMLProfile(); //start up the Profile class for XML usage. Same as Mach3's.
   //XML reading and writing can occur here..
   DoMyConfig (DevProf);
   delete DevProf;

And here is the code from myConfig() which gets called from the origina
Code: [Select]
void myConfig (CXMLProfile *DevProf)
   DoMyConfig( DevProf );
} // myConfig

I have code inside the DoMyConfig() routine that reads back from the XML data (still in memory??) via a DevProf->GetProfileInt() call that verifies that, when I'm done DevProf does contain the new data.  However, if I exit Mach and re-start it (or look at the actual XML file), the data is un-changed *IF* I've gone through the "Plugin Config" menu.  It works just fine going through the "Config->Config Plugins" dialog.

The only difference is perhaps the Mach environment when each gets called (maybe???).  Any hints as to what I may be doing wrong or how to get the changes saved into the XML?

Merry Christmas and Happy Chanukah
Re: Trouble saving plugin cfg from Plugins Control menu
« Reply #1 on: January 12, 2012, 02:06:41 PM »

my honest opinion? You don't do anything wrong, it's Mach3's sometimes strange behaviour  ;)

I do write the parameters to the XML during the DLL call StopPlug. Then they are in the XML.

best regards,