Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LoadLibrary examples

32 views
Skip to first unread message

Paul MacFarlane

unread,
Dec 17, 1997, 3:00:00 AM12/17/97
to

Does anyone know where I can get an example if "LoadLibrary" and
"GetProcAddress" from within an MFC application.

The documentation doesn't seem to match what the compiler accepts.
LoadLibary is supposed to return a handle to the DLL, but it won't compile
if I assign the result. It's acting like it void.
tia,
--
Paul MacFarlane
http://www.business-plaza.com
http://www.sb.net/amerisft/

Kyui Oh

unread,
Dec 17, 1997, 3:00:00 AM12/17/97
to Paul MacFarlane

Here a small example, hope it helps.

HINSTANCE hinstLib;
typedef int (CALLBACK* LPFNDLLFUNC)(char*);
hinstLib = LoadLibrary("MYDLL.DLL");
if (hinstLib != NULL)
{
LPFNDLLFUNC pFuncAddress = (LPFNDLLFUNC)GetProcAddress(hinstLib,
"FUNCTIONNAME");
pFuncAddress();
FreeLibrary(hinstLib);
}
return 1;

--
Kyui Oh

Software Analyst
Promis Systems Corporation
Toronto, Ontario
Canada

kyu...@promis.com

0 new messages