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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Win32 Resources - Data size

Win32 Resources - Data size

Scheduled Pinned Locked Moved C / C++ / MFC
performancequestionlearning
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.
  • H Offline
    H Offline
    Heinz_
    wrote on last edited by
    #1

    Hi everyone, I'm trying to load a resource (mp3 file) into global memory so other apps can access the resource. I use the combination of FindResourceEx/LoadResource/LockResource (it works perfect) and i'm able to get the pointer to the data but it's useless since i don't have access to the size of the resource so, apps don't know how many bytes to read. What can i do to get the data size??? Thanks in advance.

    E T 2 Replies Last reply
    0
    • H Heinz_

      Hi everyone, I'm trying to load a resource (mp3 file) into global memory so other apps can access the resource. I use the combination of FindResourceEx/LoadResource/LockResource (it works perfect) and i'm able to get the pointer to the data but it's useless since i don't have access to the size of the resource so, apps don't know how many bytes to read. What can i do to get the data size??? Thanks in advance.

      E Offline
      E Offline
      Ernest Laurentin
      wrote on last edited by
      #2

      Use SizeofResource on the handle that you get from FindResourceEx

      1. I will develop myself to the maximum of my potential in all ways 2. I will look for the good in all people and make them feel worthwhile. 3. If I have nothing good to say about a person, I will say nothing. 4. I will always be as enthusiastic about the success of others as I am about my own. 5. I will always remain loyal to God, my country, family and my friends - Chuck Norris
      Ernest Laurentin

      1 Reply Last reply
      0
      • H Heinz_

        Hi everyone, I'm trying to load a resource (mp3 file) into global memory so other apps can access the resource. I use the combination of FindResourceEx/LoadResource/LockResource (it works perfect) and i'm able to get the pointer to the data but it's useless since i don't have access to the size of the resource so, apps don't know how many bytes to read. What can i do to get the data size??? Thanks in advance.

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        Have a look at this article by David Crow :- http://www.codeproject.com/KB/cpp/UpdateResource.aspx[^] or try this wrapper class, who will abstract reading and writing from resource :- http://www.codeproject.com/KB/cpp/dynares.aspx[^]

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
        Never mind - my own stupidity is the source of every "problem" - Mixture

        cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/codeProject$$>

        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