hm i use us untimate but i think its possible with vc++ too.
you make a new c++ cli dynamic library, and then add the following file:
Code:
#pragma unmanaged
#include<Windows.h>
#include "managedStart.h"
DWORD WINAPI ThreadProc(LPVOID lpParameter);
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
CreateThread(NULL,NULL,ThreadProc,NULL,0,NULL);
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
DWORD WINAPI ThreadProc(LPVOID lpParameter)
{
Sleep(200);
ManagedStart();
return 0;
}
ManagedStart is a managed! function declared in managedStart.h, and defined in managedStart.cpp which calls your function from your C# dll.