Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. API for getting resource Handle

API for getting resource Handle

Scheduled Pinned Locked Moved C / C++ / MFC
jsonlearning
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    neha agarwal27
    wrote on last edited by
    #1

    Hi all, Can anybody tell me is there any other api for finding resource handle except AfxGetResourceHandle() in vc2005 thanks in advance...

    R L 2 Replies Last reply
    0
    • N neha agarwal27

      Hi all, Can anybody tell me is there any other api for finding resource handle except AfxGetResourceHandle() in vc2005 thanks in advance...

      R Offline
      R Offline
      Rajkumar R
      wrote on last edited by
      #2

      AfxFindResourceHandle()

      1 Reply Last reply
      0
      • N neha agarwal27

        Hi all, Can anybody tell me is there any other api for finding resource handle except AfxGetResourceHandle() in vc2005 thanks in advance...

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Hello there, I believe that AfxGetResourceHandle() is simply returning the allocation base of the module which contains the resource your attempting to access. This is so it can correctly calculate PE image offsets. Therefore you should be able to simply do the following: If the resource is located inside the module your executing code from you can do this:#define MyGetResourceHandle ((HINSTANCE)&__ImageBase) HICON hIco1 = (HICON) LoadImage(MyGetResourceHandle,MAKEINTRESOURCE(IDI_ICON1),IMAGE_ICON,16,16,0);
        Best Wishes, -David Delaune

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups