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. Win32 DLL Resource not found Error

Win32 DLL Resource not found Error

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++jsontutoriallearning
5 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
    Nitheesh George
    wrote on last edited by
    #1

    Hi every one, I develpoing a MFC application which uses a Win32 dll. This Win32 dll contains a DIALOG Box resource. I wanted to show this dialog by calling an exported function from this dll. But when calling this dialog through DialogboxParam API it returns with error 1812( RESOURCE NOT FOUND). I am solved this problem in MFC by calling AFX_MANAGE_STATE(AfxGetStaticModuleState( )). How to do this in Win32 way. thanks Nitheesh

    Jose Jo Martin http://www.simpletools.co.in

    I 1 Reply Last reply
    0
    • N Nitheesh George

      Hi every one, I develpoing a MFC application which uses a Win32 dll. This Win32 dll contains a DIALOG Box resource. I wanted to show this dialog by calling an exported function from this dll. But when calling this dialog through DialogboxParam API it returns with error 1812( RESOURCE NOT FOUND). I am solved this problem in MFC by calling AFX_MANAGE_STATE(AfxGetStaticModuleState( )). How to do this in Win32 way. thanks Nitheesh

      Jose Jo Martin http://www.simpletools.co.in

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      For pure Win32... The DialogBox function has a first parameter of

      hInstance

      , which is the HINSTANCE of the DLL where you get the resource from. If you loaded the DLL using LoadLibrary, then you already have that parameter. If not, then when the DllMain function of the DLL is called at load time, then the HINSTANCE is passed then. Just remember it! (ie, in a extern variable that all the CPP files in the DLL have access to. That's how I did it in the old days! Iain.

      I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]

      N 1 Reply Last reply
      0
      • I Iain Clarke Warrior Programmer

        For pure Win32... The DialogBox function has a first parameter of

        hInstance

        , which is the HINSTANCE of the DLL where you get the resource from. If you loaded the DLL using LoadLibrary, then you already have that parameter. If not, then when the DllMain function of the DLL is called at load time, then the HINSTANCE is passed then. Just remember it! (ie, in a extern variable that all the CPP files in the DLL have access to. That's how I did it in the old days! Iain.

        I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]

        N Offline
        N Offline
        Nitheesh George
        wrote on last edited by
        #3

        Hi Iain, I am loading the dll using LoadLibrary from a MFC application. And i am using a global HINSTANCE value from DllMain.But still this cause problem. Is this cause the resource handle of the dll be changed? thanks Nitheesh

        Jose Jo Martin http://www.simpletools.co.in

        I L 2 Replies Last reply
        0
        • N Nitheesh George

          Hi Iain, I am loading the dll using LoadLibrary from a MFC application. And i am using a global HINSTANCE value from DllMain.But still this cause problem. Is this cause the resource handle of the dll be changed? thanks Nitheesh

          Jose Jo Martin http://www.simpletools.co.in

          I Offline
          I Offline
          Iain Clarke Warrior Programmer
          wrote on last edited by
          #4

          Erm, your first email said you were succeeding with MFC. I told you how to do things in pure Win32. Now you say you still have problems. These facts do not fit each other. Please expand on what you are doing, so I can help better, Iain.

          I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]

          1 Reply Last reply
          0
          • N Nitheesh George

            Hi Iain, I am loading the dll using LoadLibrary from a MFC application. And i am using a global HINSTANCE value from DllMain.But still this cause problem. Is this cause the resource handle of the dll be changed? thanks Nitheesh

            Jose Jo Martin http://www.simpletools.co.in

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

            Hi, Try passing AfxGetResourceHandle[^] as the first parameter to the DialogBoxParam Function[^]. P.S. Your signature says your name is: Jose Jo Martin and your username says your name is Nitheesh George. Are you suffering from an identity crisis? Best Wishes, -Randor (King of Eternia) and (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