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. How to create a dialog dynamicly and show it in a dll?

How to create a dialog dynamicly and show it in a dll?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
3 Posts 2 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
    sharkmouse
    wrote on last edited by
    #1

    i tried some times but all failed.my codes below: ================================ CInstDllApp theApp; CWaitDlg *m_waitdlg=NULL; extern "C" __declspec(dllexport) int SDUnloadDriver() { AFX_MANAGE_STATE(AfxGetStaticModuleState()); AfxSetResourceHandle(theApp.m_hInstance); int res; if (m_waitdlg==NULL) { m_waitdlg=new CWaitDlg; m_waitdlg->Create(IDD_DIALOG,NULL); m_waitdlg->ShowWindow(SW_SHOW); } else { m_waitdlg->ShowWindow(SW_SHOW); } AfxSetResourceHandle(AfxGetInstanceHandle()); Sleep(1000); if (m_waitdlg!=NULL) { m_waitdlg->DestroyWindow(); delete [] m_waitdlg; m_waitdlg=NULL; } return res; } in this code i can created the dialog,and show the dialog without the controls on the dialog,and can not drag the dialog,maybe without message deal,how to solve this problem? thanks

    B 1 Reply Last reply
    0
    • S sharkmouse

      i tried some times but all failed.my codes below: ================================ CInstDllApp theApp; CWaitDlg *m_waitdlg=NULL; extern "C" __declspec(dllexport) int SDUnloadDriver() { AFX_MANAGE_STATE(AfxGetStaticModuleState()); AfxSetResourceHandle(theApp.m_hInstance); int res; if (m_waitdlg==NULL) { m_waitdlg=new CWaitDlg; m_waitdlg->Create(IDD_DIALOG,NULL); m_waitdlg->ShowWindow(SW_SHOW); } else { m_waitdlg->ShowWindow(SW_SHOW); } AfxSetResourceHandle(AfxGetInstanceHandle()); Sleep(1000); if (m_waitdlg!=NULL) { m_waitdlg->DestroyWindow(); delete [] m_waitdlg; m_waitdlg=NULL; } return res; } in this code i can created the dialog,and show the dialog without the controls on the dialog,and can not drag the dialog,maybe without message deal,how to solve this problem? thanks

      B Offline
      B Offline
      Blake Miller
      wrote on last edited by
      #2

      m_waitdlg->ShowWindow(SW_SHOW); } AfxSetResourceHandle(AfxGetInstanceHandle()); -- There is no message processing loop here at all... Sleep(1000); -- There is no message processing loop here at all... if (m_waitdlg!=NULL) { m_waitdlg->DestroyWindow(); Because the thread showing the window, presumably the only thread in program, is not processing messages.

      S 1 Reply Last reply
      0
      • B Blake Miller

        m_waitdlg->ShowWindow(SW_SHOW); } AfxSetResourceHandle(AfxGetInstanceHandle()); -- There is no message processing loop here at all... Sleep(1000); -- There is no message processing loop here at all... if (m_waitdlg!=NULL) { m_waitdlg->DestroyWindow(); Because the thread showing the window, presumably the only thread in program, is not processing messages.

        S Offline
        S Offline
        sharkmouse
        wrote on last edited by
        #3

        i know,but how to solve this problem,i do not know how to do this? thanks,can you give me some sample code or articles? best regards

        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