Hi, guys...
My simple dll example is failed when inserting SimConnect_Open function.
I inserted logging operators into definitions of DLLMain, DLLStart and DLLStop functions.
Logging is failed when SimConnect_Open function is presented in the code. I have an impression that my dll is bypassed at all.
After comment-out SimConnect_Open function my dll works as usual and logging performs. Of course, I can't connect to SimConnect
What wrong I do?
In MSVC++ 2010 Express all works perfectly.
My simple dll example is failed when inserting SimConnect_Open function.
I inserted logging operators into definitions of DLLMain, DLLStart and DLLStop functions.
Logging is failed when SimConnect_Open function is presented in the code. I have an impression that my dll is bypassed at all.
After comment-out SimConnect_Open function my dll works as usual and logging performs. Of course, I can't connect to SimConnect
What wrong I do?
In MSVC++ 2010 Express all works perfectly.
Code:
#pragma argsused
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, LPVOID lpvReserved)
{
// log we're here
FS_Log("DLLMain_in");
// first call?
if (fwdreason!=DLL_PROCESS_ATTACH)
return FALSE;
// done
FS_Log("DLLMain_out");
return TRUE;
}
int __stdcall _export DLLStart()
{
FS_Log("DLLStart");
// open connection to local SimConnect server
HRESULT hr;
[COLOR="Red"]hr = SimConnect_Open(&hSimConnect, "Dll4Fsx", NULL, 0, NULL, SIMCONNECT_OPEN_CONFIGINDEX_LOCAL);[/COLOR] if (hr == S_OK)
FS_Log("Connect success");
else FS_Log("Connect failed");
// register callback routine for message processing
// SimConnect_CallDispatch(hSimConnect, SimConnectProcess, NULL);
return 0;
}
int __stdcall _export DLLStop()
{
FS_Log("DLLStop");
return 0;
}

