Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 11th May 2008, 21:28   #1
garygumdrops
Junior Member
 
Join Date: May 2008
Location: Auckland, New Zealand
Posts: 6
Question custom plugin still unloading with SetPluginUnload alwaysoff or /NOUNLOAD

I have written a custom plugin that I would like to be kept loaded after the first call.
I am using custom functions Register and Unregister in this way:

Function .onInit
SetPluginUnload alwaysoff
NsisWMPlugin::Register /NOUNLOAD
FunctionEnd

Function .onGUIEnd
SetPluginUnload manual
NsisWMPlugin::Unregister ; NOTE no /NOUNLOAD this time
FunctionEnd

I've added messageboxes in the custom DllMain for ATTACH and DETACH so I can see when the DLL is loaded and unloaded.

If I add loads of calls to custom functions in .onInit then the DLL gets loaded once as I expect but after this function the DLL seems to get loaded/unloaded everytime even though each call has got /NOUNLOAD (which should be unnecessary as I've called SetPluginUnload alwaysoff?
I've tried the call to SetPluginUnload outside .onInit but this doesn't seem to help either.
garygumdrops is offline   Reply With Quote
Old 19th May 2008, 04:19   #2
garygumdrops
Junior Member
 
Join Date: May 2008
Location: Auckland, New Zealand
Posts: 6
I have discovered that putting a semi-colon right after '/NOUNLOAD' is bad but haven't done much testing.
It seems to screw up the stack and ignores the /NOUNLOAD flag.

So if you are 'C' programmer and can't live without your semi-colons then put use some white space:

NsisPlugin::MyFunc /NOUNLOAD ; this is a comment
garygumdrops is offline   Reply With Quote
Old 19th May 2008, 04:45   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,539
just like "MessageBox mb_ok ab;cd" will show 'ab;cd', this is not a big surprise as the script syntax has no end symbol like C, and only supports one instruction per line

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump