PDA

Click to See Complete Forum and Search --> : How do I free up a library


abdul
Aug 2nd, 2001, 08:25 PM
How do Free up a library at the end of the program, that I have already loaded I am using the code to initialize the library:

HANDLE hrtflib;
hrtflib = LoadLibrary("RICHED32.DLL");


Now, when the window destroys I use this code to free up the library:

FreeLibrary(hrtflib);
hrtflib = NULL;

But I get an error message saying that cannot convert parameter 1 from void * to _HINSTANCE

how do you fix it?

parksie
Aug 4th, 2001, 01:31 AM
Declare it as HMODULE not HANDLE.

abdul
Aug 4th, 2001, 05:08 AM
Thanks.

I was just reading "Programming windows 95 user interface" and following the same code, then got this error.

There are lots of other errors too in her book:mad:

parksie
Aug 4th, 2001, 05:40 AM
A lot of things have changed since Windows 95. Microsoft have made the internal structure a lot more logical, which means that the library functions now operate using HMODULE/HINSTANCE rather than pure HANDLE.

abdul
Aug 8th, 2001, 07:33 PM
Thanks a lot Parskie!