Click here to Skip to main content
15,900,704 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Key handling in a windowless control [modified] Pin
TClarke26-May-06 1:01
TClarke26-May-06 1:01 
GeneralRe: Key handling in a windowless control [modified] Pin
Stephen Hewitt28-May-06 22:49
Stephen Hewitt28-May-06 22:49 
GeneralRe: Key handling in a windowless control [modified] Pin
TClarke29-May-06 23:36
TClarke29-May-06 23:36 
GeneralRe: Key handling in a windowless control [modified] Pin
Stephen Hewitt30-May-06 13:45
Stephen Hewitt30-May-06 13:45 
GeneralRe: Key handling in a windowless control [modified] Pin
TClarke31-May-06 0:21
TClarke31-May-06 0:21 
GeneralRe: Key handling in a windowless control [modified] Pin
Stephen Hewitt31-May-06 13:43
Stephen Hewitt31-May-06 13:43 
GeneralRe: Key handling in a windowless control [modified] Pin
TClarke31-May-06 23:53
TClarke31-May-06 23:53 
GeneralRe: Key handling in a windowless control [modified] Pin
Stephen Hewitt1-Jun-06 14:05
Stephen Hewitt1-Jun-06 14:05 
ActiveX controls made by the ATL wizard already have an implementation of IOleInPlaceActiveObject::TranslateAccelerator inherited from the ATL class IOleInPlaceActiveObjectImpl; but you're overriding it and returning S_OK. You're making two mistakes here:
 1. You're not calling the base class so you're short circuiting all the code in ATL's implementation.
 2. By returning S_OK you're telling the controls container (IE) not to process the message further.

Remove all IOleInPlaceActiveObject methods you've put in from your control; ATL implements this low level interface for you. If you want to pre-translate a message add a function with the following signature to your control.
BOOL PreTranslateAccelerator(LPMSG /*pMsg*/, HRESULT& /*hRet*/)


If you don't handle a message in this function you should return FALSE.

A similar situation exists for the IOleInPlaceObjectWindowless inteface. The ATL wizard has already done the all the heavy lifting in the methods inherited from the ATL class IOleInPlaceObjectWindowlessImpl; remove all the methods you've added from this interface (like OnWindowMessage) and handle messages with message maps using the wizard like I explained a while ago.

Essentially your problem is you're trying to do too much: ATL handles many of the low level details for you but you’re cutting it off at the knees.

Good luck.


Steve
GeneralRe: Key handling in a windowless control [modified] Pin
TClarke1-Jun-06 23:24
TClarke1-Jun-06 23:24 
GeneralRe: Key handling in a windowless control [modified] Pin
Stephen Hewitt5-Jun-06 14:27
Stephen Hewitt5-Jun-06 14:27 
GeneralRe: Key handling in a windowless control [modified] Pin
TClarke5-Jun-06 23:01
TClarke5-Jun-06 23:01 
GeneralRe: Key handling in a windowless control [modified] Pin
Stephen Hewitt6-Jun-06 1:33
Stephen Hewitt6-Jun-06 1:33 
GeneralRe: Key handling in a windowless control [modified] Pin
TClarke6-Jun-06 2:02
TClarke6-Jun-06 2:02 
GeneralRe: Key handling in a windowless control [modified] Pin
Stephen Hewitt6-Jun-06 3:25
Stephen Hewitt6-Jun-06 3:25 
GeneralRe: Key handling in a windowless control [modified] Pin
TClarke6-Jun-06 3:40
TClarke6-Jun-06 3:40 
QuestionBandObject Question [modified] Pin
hung_ngole25-May-06 1:53
hung_ngole25-May-06 1:53 
QuestionSendMessage not working Pin
HarishDixit25-May-06 0:24
HarishDixit25-May-06 0:24 
AnswerRe: SendMessage not working Pin
Michael Dunn25-May-06 6:58
sitebuilderMichael Dunn25-May-06 6:58 
QuestionCustom Frame Window Pin
HakunaMatada24-May-06 21:22
HakunaMatada24-May-06 21:22 
AnswerRe: Custom Frame Window Pin
wpapers19-Aug-06 23:24
wpapers19-Aug-06 23:24 
QuestionSteps to create a simple ATL DLL using the VS2005 AppWizard... Pin
Defenestration23-May-06 15:57
Defenestration23-May-06 15:57 
QuestionIE plugin Pin
hung_ngole22-May-06 15:41
hung_ngole22-May-06 15:41 
AnswerRe: IE plugin Pin
Michael Dunn23-May-06 6:35
sitebuilderMichael Dunn23-May-06 6:35 
GeneralRe: IE plugin Pin
hung_ngole24-May-06 6:55
hung_ngole24-May-06 6:55 
QuestionCOM+ noncreatable and IObjectContext Pin
sameeraperera21-May-06 18:00
sameeraperera21-May-06 18:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.