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. Modeless API dialog hangs after creation

Modeless API dialog hangs after creation

Scheduled Pinned Locked Moved C / C++ / MFC
json
4 Posts 3 Posters 1 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.
  • K Offline
    K Offline
    KnaveR777
    wrote on last edited by
    #1

    Hello All, I have created a DLL that has an export which calls CreateDialog to make a modeless DLL. CreateDialog(hDLL, MAKEINTRESOURCE(IDD_DIALOG1), mWnd, (DLGPROC)DlgCallBack); When called, the dialog pops up and everything seems to go right... but locks-up as soon as i click or drag mouse into the dialog. My guess is that something might be going wrong with the way I handle messages or something weird caused by using a dll that I am not aware of, but am not sure since i am new to windows programming. Here is the code in my callback switch(uMsg) { case WM_COMMAND: switch(wParam){ case IDOK: return TRUE; } break; case WM_DESTROY: PostQuitMessage(0); return true; case WM_CLOSE: DestroyWindow(hwnd); return TRUE; } return FALSE;

    N T 2 Replies Last reply
    0
    • K KnaveR777

      Hello All, I have created a DLL that has an export which calls CreateDialog to make a modeless DLL. CreateDialog(hDLL, MAKEINTRESOURCE(IDD_DIALOG1), mWnd, (DLGPROC)DlgCallBack); When called, the dialog pops up and everything seems to go right... but locks-up as soon as i click or drag mouse into the dialog. My guess is that something might be going wrong with the way I handle messages or something weird caused by using a dll that I am not aware of, but am not sure since i am new to windows programming. Here is the code in my callback switch(uMsg) { case WM_COMMAND: switch(wParam){ case IDOK: return TRUE; } break; case WM_DESTROY: PostQuitMessage(0); return true; case WM_CLOSE: DestroyWindow(hwnd); return TRUE; } return FALSE;

      N Offline
      N Offline
      Nilesh K
      wrote on last edited by
      #2

      KnaveR wrote: which calls CreateDialog to make a modeless DLL. Did you mean modeless dialog? KnaveR wrote: but locks-up as soon as i click or drag mouse into the dialog. Could you explain a bit on what you mean by that.

      - Nilesh "Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw

      1 Reply Last reply
      0
      • K KnaveR777

        Hello All, I have created a DLL that has an export which calls CreateDialog to make a modeless DLL. CreateDialog(hDLL, MAKEINTRESOURCE(IDD_DIALOG1), mWnd, (DLGPROC)DlgCallBack); When called, the dialog pops up and everything seems to go right... but locks-up as soon as i click or drag mouse into the dialog. My guess is that something might be going wrong with the way I handle messages or something weird caused by using a dll that I am not aware of, but am not sure since i am new to windows programming. Here is the code in my callback switch(uMsg) { case WM_COMMAND: switch(wParam){ case IDOK: return TRUE; } break; case WM_DESTROY: PostQuitMessage(0); return true; case WM_CLOSE: DestroyWindow(hwnd); return TRUE; } return FALSE;

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

        KnaveR wrote: return FALSE; Instead of above call DefDlgProc

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        cheers, Alok Gupta

        K 1 Reply Last reply
        0
        • T ThatsAlok

          KnaveR wrote: return FALSE; Instead of above call DefDlgProc

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          cheers, Alok Gupta

          K Offline
          K Offline
          KnaveR777
          wrote on last edited by
          #4

          Thnx to both of you.... Sorry for the late reply Sorry for not properly specifying, but by locking up i ment the infamous " has encountered a problem and needs to close" was poping up. For further clarification on what causes this lock up, this occurs anytime I click on the window of the app (mIRC) that calls my dll or move the mouse into my dialog's window. Anyways, after using DefDlgProc, this problem goes away, but the calling app (mIRC) immediately terminates without notice. Any ideas?

          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