Results 1 to 12 of 12

Thread: LoadImage issue

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    95

    Exclamation LoadImage issue

    Hi all,

    I wrote an Icon class to easily handle 32bit icons in VB6. I used following project as example: Systray Icon
    The problem, which I am facing is, that in my class one icon cannot be loaded - but in the example it is! And I dont see a difference between both projects...
    Here you can download my Demo Class.

    The icon which is not loaded is the second icon in the resource file (ICON_0). But both projects are using the same resource file.
    The LoadImage function is used for resource file icons in the compiled project only. So you should compile it to see the problem.
    I added the LoadImage call twice: the first call uses the W-variant of the API, the second the A-variant, like it is done in the example.
    Both calls fail in my demo for the second icon. But the first icon (INT resource) is loaded correctly - and in the example this second icon is loaded too.
    No dll error occurs - the returned handle is just zero.

    Can you reproduce this behavoir?
    Do you see the problem source?

    Here you can see the loaded icon in the example:
    Name:  loaded_icon.png
Views: 1994
Size:  37.5 KB

    And here the missing one in my demo:
    Name:  missing_icon.png
Views: 1898
Size:  94.2 KB

    While writing the class, I found two other APIs: LoadIcon and LoadIconMetric. Can somebody tell me the differences/advantages/disadvantages of these two compared to LoadImage?
    Last edited by NeedHelp!; Jan 3rd, 2013 at 06:54 AM.

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