07-13-2006 03:27 PM
07-14-2006 03:47 AM
LabVIEW simply uses LoadLibrary() to load a shared library into memory. It has no direct control of how Windows will initialize that DLL inside the LoadLibrary() function. It may be that the DLL is already loaded somewhere, somehow or that Windows decides that it needs not to initialize the DLL anymore. As to why and how this could happen you would be better of asking MS or some low leverl Windows API guru, not NI.
@Tomi M wrote:
I used the code below.#include <iostream>Tomi
#include <fstream>
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
using namespace std;
ofstream out("C:\log.txt", ios::app);
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
out << "DLL_PROCESS_ATTACH" << endl;
break;
case DLL_THREAD_ATTACH:
out << "DLL_THREAD_ATTACH" << endl;
break;
case DLL_THREAD_DETACH:
out << "DLL_THREAD_DETACH" << endl;
break;
case DLL_PROCESS_DETACH:
out << "DLL_PROCESS_DETACH" << endl;
break;
}
return TRUE;
}