News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

LoadLibrary

Started by ragdog, November 22, 2009, 10:19:14 PM

Previous topic - Next topic

ragdog

Hi

I have a question to this api LoadLibrary
Map this a dll to the memory?

Can i use CreateFileMapping>> MapViewOfFile for use this dll with GetProcaddress?
Or can i use FindResource>>SizeofResource>>LoadResource>>LockResource?

Greets,

Vortex

Hi ragdog,

The problem is that if you loade the DLL as binary data ( for example from resource ) , you have to do all the PE section initializations.

xandaz

    Well,.... i have some questions too in a related subject matter. Is there a limit for resource opperations after a library is loaded? In this prog i'm attaching to this post, i load resources - essencially bitmaps, icons and cursors - from shell32.dll. Then i insert the images into a ListView control. The viewing is done throught a treeview control with the resource types and names. What happens is that if i insist a little on choosing a resource type and then another, the images all go away i don't know why. Everytime there a TVN_SELCHANGE msg the images are loaded and freed so i don't know what could be wrong. Someone take a peek into what i've done and see if you get where the problem is. Thanks guys, you're the best.
   Bye
   XXXX

dedndave

this does not answer your question, but it may help you find the problem
i am running XP MCE SP3
see attached pic

xandaz

Quote from: dedndave on August 25, 2010, 11:55:14 PM
this does not answer your question, but it may help you find the problem
i am running XP MCE SP3
see attached pic
Thanks a lot dedndave....bye

xandaz

   i'm not sure yet what to do with the picture. I feel you're giving me some hints but not really telling me whats wrong. Do you know what's wrong? Is this some sort of educational thingy?
   Well... thanks anyway.... i guess i must get my brains working.
   Bye and ty Ded

dedndave

no - i don't know what the problem is
i only noticed that some icons are not displayed properly
i wasn't sure if you saw what i saw, as you may be using a different OS

xandaz

    oh yeah... They're toolbar bitmaps. It seems you can use a single bitmap for toolbar. the bitmap is for ex. only 32 high but images*32 long. But i don't think that that's the problem. Well...
   .... thanks

xandaz

   can we close a handle returned by findresource? It seems at seems at some point findresource fails and i cant load any more images.
   Thanks guys.

Vortex

Terminating the application should release the handle returned by FindResource

xandaz

    What if i don't want to terminate the application? is there a specific finction to release that type of handle?
   Thanks.

Vortex

Not sure but one of those functions could solve the problem : DestroyAcceleratorTable , DeleteObject , DestroyCursor , DestroyIcon , DestroyMenu

xandaz

   All things were destroyed after having been added to the imagelist. I think it's the find resource function that isn't working. Well... i think i'll pass this and construct all of the list views on application start and that's the end of it.
   Thanks.