Question: I have created a DLL in VC++ as Win32 project 

DLLMAIN function is 

```
BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    return TRUE;
}

```

Now I need HINSTANCE of the DLL , that need to be passed to Win32 functions.

Are HMODULE and HINSTANCE same?

How can I get HINSTANCE?

Answer: 
I think that these are the same. If you want HINSTANCE of the running process (exe), you should use 

```
GetModuleHandle(NULL);

```
DllMain function as it's described in MSDN:

```
BOOL WINAPI DllMain(
  __in  HINSTANCE hinstDLL,
  __in  DWORD fdwReason,
  __in  LPVOID lpvReserved
);

```

<http://msdn.microsoft.com/en-us/library/ms682583%28v=vs.85%29.aspx>