Re: DllMain vs. DllMain

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



In theory on some future non NT-based implementation of Win32 HINSTANCE (==
HMODULE) may not be void * and not compatible with HANDLEs. In practice this
is almost unthinkable. Lots of Win32 code assumes HMODULE is a pointer to
the beginning of DLL in memory. Lots of Win32 code (including VC CRT)
assumes that HANDLE is void *. Together these facts mean that for the
foreseeable future HANDLE is going to be freely interchangeable with
HMODULE.

Note that on NT based systems HANDLEs are designed to be compatible with
HINSTANCEs. AFAIK the native NT API functions that deal
with DLLs (LdrXXX family) are all defined in terms of HANDLEs.

--
Eugene
http://www.gershnik.com



.



Relevant Pages

  • Re: Pfad einer Dll
    ... Da kam der Explorer zurück. ... >> Über die Funktion GetModuleFileName versuche ich zur Zeit den Pfad der ... >> Dll rauszulesen. ... > HMODULE hModule, ...
    (microsoft.public.de.vc)
  • Cant find the DLL entry point
    ... I use the C++.NET to write a dll and call the dll using VB6. ... BOOL APIENTRY DllMain(HINSTANCE hModule, ... End Sub ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Overflow Error with GetModuleFileName() on Windows Vista
    ... When I develop applications or dlls, and each of them must know wether it runs in the IDE, ... Here the dll uses its IsInIDE function itself and so the function then should report True when the dll itself is running uncompiled in the IDE. ... Dim hModule As Long, lLen As Long ... Dim strModule As String * 256 ...
    (microsoft.public.vb.general.discussion)
  • RE: Regular DLL How To register
    ... You cannot register a non COM dll(which doesn't export DllRegisterServer func) ... FARPROC GetProcAddress(HMODULE hModule, LPCSTR lpProcName); ... > I have created Regular dll statically linked with mfc (no automation ... > client EXE will load that dll from that path.? ...
    (microsoft.public.vc.mfc)