Windows Mutex won't work with active Skinning |
Post Reply |
Author | |
MatthiasB
Newbie Joined: 15 September 2009 Status: Offline Points: 1 |
Post Options
Thanks(0)
Posted: 15 September 2009 at 3:28am |
I'm using Visual DataFlex 2009 v15 together with CodeJock v13.1.
We tried to avoid loading the same DataFlex program twice with the use of Mutex.
The following code works fine if I use the program caption in order to create a Mutex.
// external functions
#IFNDEF Get_CreateMuteX External_Function CreateMuteX "CreateMutexA" Kernel32.dll Integer i1 Integer i2 Integer i3 Returns Integer #ENDIF #IFNDEF Get_CloseHandle External_Function CloseHandle "CloseHandle" Kernel32.dll Integer i1 Returns Integer #ENDIF // function to create a mutex Function Create_MuteX_Object String sLabel Returns Boolean Integer iVoid iErr String sID Move sLabel to sID Move (CreateMuteX(0,1,AddressOf(sID))) to ghMuteX If (ghMuteX <> ERROR_INVALID_HANDLE) Begin Move (GetLastError()) to iErr If (iErr = ERROR_ALREADY_EXISTS) Begin // program is already // running Move (CloseHandle(ghMuteX)) to iVoid Move 0 to ghMuteX // kill the application here if you do not want to allow // multiple instances Function_Return False End Else Send None // program is not already running End Else Send None // rare error; object could not be created Function_Return True End_Function // Create_MuteX_Object However if my program contains a Skin object:
Object oSkin is a cCJSkinFramework
Set psSkinFile to "..." Set psSkinIni to "..." End_Object the function Create_MuteX_Object always creates a new mutex object ??!
Any ideas?
|
|
_____________
Best Regards Matthias |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |