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. What can be an alternative to AFX_MANAGE_STATE macro?

What can be an alternative to AFX_MANAGE_STATE macro?

Scheduled Pinned Locked Moved C / C++ / MFC
c++questionhelplearning
6 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.
  • S Offline
    S Offline
    Sameerkumar Namdeo
    wrote on last edited by
    #1

    Currently I have constucted a DLL in VC++ 6.0 in which does not uses MFC. I have chosen Win32 Dynamic Link Library template from new project dialog box. Now, only one function is exported from the DLL. In that function I am bringing up an Dialog Box using DialogBoxParam() function. Dialog resource is stored in the DLL itself. DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_DOCONVERTDIALOGBOX), NULL, DoConvert_DlgProc, (LPARAM)(&pDlg)); I have also added a dialog box with ID 'DOCONVERTDIALOGBOX' in the resource of this DLL project. * DialogBoxParam() returns -1. * GetLastError() returns 1814 (ERROR_RESOURCE_NAME_NOT_FOUND) I think if I add AFX_MANAGE_STATE(AfxGetStaticModuleState()); then it will take the resource from DLL. But AFX_MANAGE_STATE is MFC related. And I am not using any MFC related function nor my DLL project is using MFC. So how can I load the dialog resource from DLL. Thanks in advance.

    N K 2 Replies Last reply
    0
    • S Sameerkumar Namdeo

      Currently I have constucted a DLL in VC++ 6.0 in which does not uses MFC. I have chosen Win32 Dynamic Link Library template from new project dialog box. Now, only one function is exported from the DLL. In that function I am bringing up an Dialog Box using DialogBoxParam() function. Dialog resource is stored in the DLL itself. DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_DOCONVERTDIALOGBOX), NULL, DoConvert_DlgProc, (LPARAM)(&pDlg)); I have also added a dialog box with ID 'DOCONVERTDIALOGBOX' in the resource of this DLL project. * DialogBoxParam() returns -1. * GetLastError() returns 1814 (ERROR_RESOURCE_NAME_NOT_FOUND) I think if I add AFX_MANAGE_STATE(AfxGetStaticModuleState()); then it will take the resource from DLL. But AFX_MANAGE_STATE is MFC related. And I am not using any MFC related function nor my DLL project is using MFC. So how can I load the dialog resource from DLL. Thanks in advance.

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      ccpptrain wrote:

      DialogBoxParam(hInstance,

      How are you getting the instance handle? It should be the one you get in DllMain as an argument.


      Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

      S 3 Replies Last reply
      0
      • S Sameerkumar Namdeo

        Currently I have constucted a DLL in VC++ 6.0 in which does not uses MFC. I have chosen Win32 Dynamic Link Library template from new project dialog box. Now, only one function is exported from the DLL. In that function I am bringing up an Dialog Box using DialogBoxParam() function. Dialog resource is stored in the DLL itself. DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_DOCONVERTDIALOGBOX), NULL, DoConvert_DlgProc, (LPARAM)(&pDlg)); I have also added a dialog box with ID 'DOCONVERTDIALOGBOX' in the resource of this DLL project. * DialogBoxParam() returns -1. * GetLastError() returns 1814 (ERROR_RESOURCE_NAME_NOT_FOUND) I think if I add AFX_MANAGE_STATE(AfxGetStaticModuleState()); then it will take the resource from DLL. But AFX_MANAGE_STATE is MFC related. And I am not using any MFC related function nor my DLL project is using MFC. So how can I load the dialog resource from DLL. Thanks in advance.

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

        Figure out what is done the the macro. :zzz:

        Greetings from Germany

        1 Reply Last reply
        0
        • N Nibu babu thomas

          ccpptrain wrote:

          DialogBoxParam(hInstance,

          How are you getting the instance handle? It should be the one you get in DllMain as an argument.


          Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

          S Offline
          S Offline
          Sameerkumar Namdeo
          wrote on last edited by
          #4

          Well I will try it...

          1 Reply Last reply
          0
          • N Nibu babu thomas

            ccpptrain wrote:

            DialogBoxParam(hInstance,

            How are you getting the instance handle? It should be the one you get in DllMain as an argument.


            Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

            S Offline
            S Offline
            Sameerkumar Namdeo
            wrote on last edited by
            #5

            I am passing NULL for instance. Well, I will try your suggestion

            1 Reply Last reply
            0
            • N Nibu babu thomas

              ccpptrain wrote:

              DialogBoxParam(hInstance,

              How are you getting the instance handle? It should be the one you get in DllMain as an argument.


              Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

              S Offline
              S Offline
              Sameerkumar Namdeo
              wrote on last edited by
              #6

              Thanks Nibu it is working.

              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