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. PreTranslateMessage problems

PreTranslateMessage problems

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
4 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.
  • A Offline
    A Offline
    Aviv Halperin
    wrote on last edited by
    #1

    Yesterday I asked in this forum about a problem: I could never get the PreTranslateMessage in my dialogs. I found a solution: for my current project I use MFC in a dll (staticaly linked). I had to give an interface to the application that starts the dll an overide the PreTranslateMessage function of the application to call the interface function that activates the PreTranslateMessage mechanism. Aviv.

    J 1 Reply Last reply
    0
    • A Aviv Halperin

      Yesterday I asked in this forum about a problem: I could never get the PreTranslateMessage in my dialogs. I found a solution: for my current project I use MFC in a dll (staticaly linked). I had to give an interface to the application that starts the dll an overide the PreTranslateMessage function of the application to call the interface function that activates the PreTranslateMessage mechanism. Aviv.

      J Offline
      J Offline
      John R Shaw
      wrote on last edited by
      #2

      I was not here yesterday; but in general, you do not want to staticaly link to the MFC DLL (mass overhead). I have more than one class that overides the PreTranslateMessage function and none of them required that MFC be staticaly linked. For that matter PreTranslateMessage was disigned to be overriden, that is, it is a member of the CWnd class which is the base of all window based objects. INTP

      A 1 Reply Last reply
      0
      • J John R Shaw

        I was not here yesterday; but in general, you do not want to staticaly link to the MFC DLL (mass overhead). I have more than one class that overides the PreTranslateMessage function and none of them required that MFC be staticaly linked. For that matter PreTranslateMessage was disigned to be overriden, that is, it is a member of the CWnd class which is the base of all window based objects. INTP

        A Offline
        A Offline
        Aviv Halperin
        wrote on last edited by
        #3

        Linking the dll dinamicaly to MFC would not solve the problem. (I checked out the microsoft sight about this. Look at the DLLScreenCap Sample at this URL : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample/html/vcsamDllScreenCapSample.asp ) The problem with the PreTranslateMessage is, that it was not passed through to the dll automaticaly, but needs to be done manualy. avivhal

        J 1 Reply Last reply
        0
        • A Aviv Halperin

          Linking the dll dinamicaly to MFC would not solve the problem. (I checked out the microsoft sight about this. Look at the DLLScreenCap Sample at this URL : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample/html/vcsamDllScreenCapSample.asp ) The problem with the PreTranslateMessage is, that it was not passed through to the dll automaticaly, but needs to be done manualy. avivhal

          J Offline
          J Offline
          John R Shaw
          wrote on last edited by
          #4

          If it does not work staticaly it will not work dinamicaly linked either. All I know is that all the windows(/classes) derived from CWnd receive messages via PreTranslateMessage (this is a given). I do not know about this manualy stuff, I've never had to do that for PreTranslateMessage. I go to the ClasssWizard and select PreTranslateMessage and it generates the code, that works. INTP

          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