Just how to make use of a mutex in Visual Basic
I have actually imported the
kernel32 collection. So, I have the
createMutex function readily available yet I am not fairly certain of the numerous parameters and also return values.
This is timeless Visual Basic, not Visual Basic.NET yet I can possibly collaborate with either language in the kind of a solution.
The VB code looks something similar to this :
hMutex = CreateMutex(ByVal 0&, 1, ByVal 0&)
The first parameter is a reminder to an
SECURITY_ATTRIBUTES framework. If you do not recognize what it is, you do not require it. Pass NULL (0 ).
The 2nd parameter is
TRUE (non - absolutely no, or 1) if the calling string needs to take possession of the mutex.
FALSE or else.
The 3rd parameter is the mutex name and also might be NULL (0 ), as revealed. If you require a called mutex, pass the name (anything one-of-a-kind) in. Not exactly sure whether the
VB wrapper marshals the size - prefixed
VB string type (
BSTR) over to a null - ended Ascii/Unicode string otherwise, you'll require to do that and also countless instances are around.
All the best!