I have a program that I have written in
VB.NET that needs to signal an event. The program is kicked off by a parent program and when the
VB.NET program is kicked off, the parent program creates an event and stores the event object name in an environment variable. I can get the event object name, but I am not sure how to signal it.
Here is some C++ from another program that does what I am trying to do:
if( GetEnvironmentVariable("Notify",szValue,sizeof(szV alue)) )
{
hEvent = OpenEvent(EVENT_ALL_ACCESS,FALSE,szValue);
if( NULL == hEvent )
{
printf("AppStarted OpenEvent failed %d <%s>\n",
GetLastError(),szValue);
goto RET;
}
}
if (!SetEvent(hEvent))
{
printf("AppStarted SetEvent failed %d <%s>\n",
GetLastError(),
szValue);
goto RET;
}
}
Here is what I have so far in
VB.NET:
Dim szNotify as String
szNotify = Environment.GetEnvironmentVariable("Notify")
DebugPrint("Notify: " & Notify, 1)
If (szNotify.Length > 0) Then
'** Set Event Here... Some How.
End If
Does anyone know how to do this?