Being called from DLL module, guess, which one would give you odd result?
HINSTANCE h1 = AfxGetInstanceHandle();
HINSTANCE h2 = GetModuleHandle(NULL);
HINSTANCE h3 = AfxGetApp()->m_hInstance;
HINSTANCE h4 = theApp.m_hInstance;