Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to COM

Status
Not open for further replies.

other3

Programmer
Jul 30, 2002
92
US
I am trying to learn COM from the book "Inside COM". I am using Visual C++.NET to do the examples. Anyway the following:

static HMODULE g_hModule = NULL ; // DLL module handle

BOOL APIENTRY DllMain(HANDLE hModule,
DWORD dwReason,
void* lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
g_hModule = hModule ;
}
return TRUE ;
}

is giving the following error:

f:\VC\Source\Seven Com\Cmpnt\Cmpnt.cpp(324) : error C2440: '=' : cannot convert from 'HANDLE' to 'HMODULE'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast

Any assistance would be greatly appreciated.


Everything I know I learned from The Grateful Dead and Buffy The Vampire Slayer
Charlie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top