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