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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LOAD 16 bit DLL

Status
Not open for further replies.

JustBeginer

Programmer
Mar 13, 2003
39
I have a 16bit DLL without lib file. How can I use the functions in that library in my source?
 
You have to use WinAPI for that. Use

HINSTANCE LoadLibrary(LPCTSTR lpDLLFileName)

to load dll. Then, use GetModuleHandle() to obtain HMODULE for your dll. With this handle call :

FARPROC GetProcAddress(

HMODULE hModule, // handle to DLL module
LPCSTR lpProcName // name of function
);

which returns the pointer to the function in dll you need. Note that you must know exact function name and names/types of arguments that this function expects.
However, I haven't tried this with 16-bit DLLs before, but Microsoft sais it should work :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top