Results 1 to 5 of 5

Thread: How do I free up a library

  1. #1

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827

    How do I free up a library

    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?
    Baaaaaaaaah

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Declare it as HMODULE not HANDLE.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    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
    Baaaaaaaaah

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Thanks a lot Parskie!
    Baaaaaaaaah

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width