Rich78
September 27th, 2011, 10:31 AM
Hi,
Sorry that this relates to a Windows dev issue but I'm hoping you'll all look past that bit :).
I'm working on a dll in c++ and I've had to wrap the functionality within a thread as it was complaining when I called the COM Initialize as it was already open (dll is being called from C#), and I'm basically just wrapping up some existing code from the vshadow sample in the Windows api.
I'm calling the following code:
hdl = CreateThread(NULL, 0, mainThread, (LPVOID)&p, 0, NULL);
if (hdl == NULL)
ExitProcess(Data_Of_mainThread);
WaitForSingleObject(hdl,INFINITE);
CloseHandle(hdl);
DWORD WINAPI mainThread(LPVOID lpParam)
{
//Thread code blah blah blah
}
As you can see mainThread has a return of DWORD, which I'm led to believe is basically an unsigned int.
I'm wanting to return a GUID from the code within mainThread back to the code that executed the CreateThread method.
All is in the same class.
Thanks for any help.
Sorry that this relates to a Windows dev issue but I'm hoping you'll all look past that bit :).
I'm working on a dll in c++ and I've had to wrap the functionality within a thread as it was complaining when I called the COM Initialize as it was already open (dll is being called from C#), and I'm basically just wrapping up some existing code from the vshadow sample in the Windows api.
I'm calling the following code:
hdl = CreateThread(NULL, 0, mainThread, (LPVOID)&p, 0, NULL);
if (hdl == NULL)
ExitProcess(Data_Of_mainThread);
WaitForSingleObject(hdl,INFINITE);
CloseHandle(hdl);
DWORD WINAPI mainThread(LPVOID lpParam)
{
//Thread code blah blah blah
}
As you can see mainThread has a return of DWORD, which I'm led to believe is basically an unsigned int.
I'm wanting to return a GUID from the code within mainThread back to the code that executed the CreateThread method.
All is in the same class.
Thanks for any help.