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. Problem With Message Handling in Modeless Dialog

Problem With Message Handling in Modeless Dialog

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpvisual-studiocomquestion
1 Posts 1 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.
  • D Offline
    D Offline
    Doug Knudson
    wrote on last edited by
    #1

    Hi All, I'm really baffled and having struggled for several days, I need to bare my soul and ask for help :-) With C++ VS 6, I have created a COM component, added an ATL (Full Control), added methods and events to the appropriate interfaces and then created a modeless dialog (CDialog) in the component. The control has no CWnd so when I create the modeless dialog, I use Create (IDD,NULL) where the NULL indicates, I think, that the parent is the main app window, of which there is none, at least not in the COM component itself. Things all work well so far and I have added a bunch of standard dialog controls, buttons, statics, edit controls, etc all working fine EXCEPT I am unable to use the TAB key to move between edit controls. In general, it seems that mouse messages are sent to the dialog where I can handle them but most keyboard messages (WM_CHAR, WM_KEYDOWN, WM_KEYUP, etc. are not. In fact, I even added a PreTranslateMessage handler to the dialog, but it never even gets called? In desperation, I added a PreTranslateMessage handler to the "MFC host app" that instantiates and uses the COM component and indeed I can capture the messages of interest from the CDialog in the COM component, WM_CHAR, WM_KEYDOWN, WM_KEYUP, etc but of course it doesn't do me much good to have the messages at this high level. My guess is that the messages get to the MFC host app because, to a COM component, the host app "is" the main application window?? Either way, I really need to have the dialog in the COM component allow the user to tab between edit controls. Any help would be greatly appreciated. Thanks, Doug Doug Knudson

    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