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. Deleting resouce problem

Deleting resouce problem

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

    hi, i want to delete the resouce in such a way: UpdateResource( m_hModule, "MY_RES_TYPE", MAKEINTRESOURCE( IDR_MY_RES1 ), MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL ) , NULL, 0 ); MSDN: If lpData is NULL, the specified resource is deleted from the executable file. GetLastError ===87 — The parameter is incorrect. How can i handle this??? If i do this: UpdateResource( m_hModule, "MY_RES_TYPE", MAKEINTRESOURCE( IDR_MY_RES1 ), MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL ) , lpData, 1 ); UpdateResource( m_hModule, "MY_RES_TYPE", MAKEINTRESOURCE( IDR_MY_RES1 ), MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL ) , NULL, 0 ); everything's going OK but resouce isn't deleted.

    D K 2 Replies Last reply
    0
    • T TheDen

      hi, i want to delete the resouce in such a way: UpdateResource( m_hModule, "MY_RES_TYPE", MAKEINTRESOURCE( IDR_MY_RES1 ), MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL ) , NULL, 0 ); MSDN: If lpData is NULL, the specified resource is deleted from the executable file. GetLastError ===87 — The parameter is incorrect. How can i handle this??? If i do this: UpdateResource( m_hModule, "MY_RES_TYPE", MAKEINTRESOURCE( IDR_MY_RES1 ), MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL ) , lpData, 1 ); UpdateResource( m_hModule, "MY_RES_TYPE", MAKEINTRESOURCE( IDR_MY_RES1 ), MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL ) , NULL, 0 ); everything's going OK but resouce isn't deleted.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Are you sure that the resource exists? Did you call EndUpdateResource()?


      "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

      1 Reply Last reply
      0
      • T TheDen

        hi, i want to delete the resouce in such a way: UpdateResource( m_hModule, "MY_RES_TYPE", MAKEINTRESOURCE( IDR_MY_RES1 ), MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL ) , NULL, 0 ); MSDN: If lpData is NULL, the specified resource is deleted from the executable file. GetLastError ===87 — The parameter is incorrect. How can i handle this??? If i do this: UpdateResource( m_hModule, "MY_RES_TYPE", MAKEINTRESOURCE( IDR_MY_RES1 ), MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL ) , lpData, 1 ); UpdateResource( m_hModule, "MY_RES_TYPE", MAKEINTRESOURCE( IDR_MY_RES1 ), MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL ) , NULL, 0 ); everything's going OK but resouce isn't deleted.

        K Offline
        K Offline
        kreaThor
        wrote on last edited by
        #3

        the problem is with the resource type which shouldn't be put in quotes. The resource type should either be one of the default resource types(e.g. RT_STRING ) or it should be the result of calling MAKEINTRESOURCE macro

        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