![]() |
Releasemutex Api ( hi! )
Hi!, this is my first post an a Russian forum :)
i'm from italy .. and.. i would use bmax for winapi access... i used in a my app, the createmutex Function CreateMutex:Int(lpMutexAttributes :Int , bInitialOwner:Int, lpName : Byte Ptr) = "CreateMutexA@12" .. but i can't perform the RELEASE.... there is anyone that can post an example for a functionally RELASEMUTEX? ( openmutex can work on Bmax? ) Thx to all :) |
Ответ: Releasemutex Api ( hi! )
http://msdn.microsoft.com/en-us/library/ms685066.aspx
Цитата:
Check MSDN for additional details. |
Ответ: Releasemutex Api ( hi! )
yes, i do that...
Const ERROR_ALREADY_EXISTS = 183 Extern "win32" Function CreateMutex:Int(lpMutexAttributes :Int , bInitialOwner:Int, lpName : Byte Ptr) = "CreateMutexA@12" Function GetLastError:Int() = "GetLastError@0" Function openmutex:Int(aaaa:Int, bbbb:Int,cccc : Byte Ptr) = "OpenMutex@12" Function ReleaseMutexA:Int(ffff :Int) = "ReleaseMutex@4" End Extern ret = CreateMutex(0,1 ,"MYMUTEX".ToCstring()) If ret<>0 If getlasterror () = ERROR_ALREADY_EXISTS Print "Already present! 1" Print releasemutexa (ret) ret = CreateMutex(0,1 ,"MYMUTEX".ToCstring()) If ret<>0 If getlasterror () = ERROR_ALREADY_EXISTS Print "already present! 2" Print releasemutexa (ret) 'an ... OPENMUTEX test..... ret = openmutex(0,1 ,"MY MUTEX".ToCstring()) 'compiler error: 'untitled4.bmx.gui.release.win32.x86.o: undefined reference to `OpenMutex@12' but... don't work , what's wrong? |
Ответ: Releasemutex Api ( hi! )
I'm not able to check this, but I believe it should be either "OpenMutexA@12", or "OpenMutexW@12".
|
Ответ: Releasemutex Api ( hi! )
у автора:
Цитата:
"OpenMutexA@12" |
Ответ: Releasemutex Api ( hi! )
maybe simple use LoadLibraryA and GetProcAddress functions ?
Код:
lib:Int = LoadLibraryA("somedll.dll") |
Ответ: Releasemutex Api ( hi! )
WOW! openmutex seems to work!
Код:
Extern "win32" for Jimon... umh... i don't know how to use the loadlibraryA... :( ( any example? ) |
Ответ: Releasemutex Api ( hi! )
i see your code works, then you don't need these functions :)
|
Ответ: Releasemutex Api ( hi! )
gatsu.
I'm trying not to be bothersome, but MSDN has answers to all questions regarding Win API ;) http://msdn.microsoft.com/en-us/libr...75(VS.85).aspx |
Ответ: Releasemutex Api ( hi! )
thx Alcosholik
|
Часовой пояс GMT +4, время: 22:23. |
vBulletin® Version 3.6.5.
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Перевод: zCarot