Click here to Skip to main content
15,924,679 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: File Properties Dialog Pin
Michael Dunn18-Apr-01 15:35
sitebuilderMichael Dunn18-Apr-01 15:35 
GeneralRe: File Properties Dialog Pin
Liam O'Hagan18-Apr-01 20:25
Liam O'Hagan18-Apr-01 20:25 
GeneralLinking problems Pin
Henrik18-Apr-01 13:58
Henrik18-Apr-01 13:58 
GeneralRe: Linking problems Pin
Michael Dunn18-Apr-01 15:01
sitebuilderMichael Dunn18-Apr-01 15:01 
GeneralRe: Linking problems Pin
Masaaki Onishi18-Apr-01 15:19
Masaaki Onishi18-Apr-01 15:19 
GeneralActiveX control problem Pin
YLLY18-Apr-01 13:54
YLLY18-Apr-01 13:54 
GeneralDLL Resources Pin
CGMon18-Apr-01 13:13
CGMon18-Apr-01 13:13 
GeneralIOleInplaceActiveObject->TranslateAccelerators give Incorrect Function error on NT Pin
18-Apr-01 11:34
suss18-Apr-01 11:34 
I'm using a CAxWindow to host a web browser in a shell namespace. To handle keys like backspace, delete, tab and not pass them on to windows explorer I use the following code to call the IOleInplaceActiveObject->TranslateAccelerators and then return S_OK so explorer does not process the keys as well. This works fine in Windows 2000 but on NT4 it returns a HRESULT
value of 1 (Incorrect Function). I can even call other IOleInplaceActiveObject methods without a problem but not TranslateAccelerators! Microsoft documentation just states that one should use basically the same code as below.

What does 'incorrect function' usually mean? Is this method not implemented?

ContainerWindow is declared as a CAxWindow

STDMETHODIMP CShellView::TranslateAccelerator(LPMSG pMsg)
{
if ((pMsg->message >= WM_KEYFIRST) && (pMsg->message <= WM_KEYLAST))
{
// Activate the control in the container
CComQIPtr<ioleobject, &iid_ioleobject=""> spOleObject;
ContainerWindow.QueryControl(IID_IOleObject, (LPVOID*)&spOleObject);

if (spOleObject)
{
RECT rect;
GetClientRect(hwndContainer, &rect);
spOleObject->DoVerb(OLEIVERB_UIACTIVATE, NULL, (IOleClientSite*)this, 0, hwndContainer, &rect);
}

}

if ( ((pMsg->message == WM_KEYDOWN || pMsg->message == WM_KEYUP) &&
(pMsg->wParam == VK_TAB || pMsg->wParam == VK_DELETE || pMsg->wParam == VK_BACK)))
{
CComQIPtr<ioleinplaceactiveobject, &iid_ioleinplaceactiveobject=""> spInPlaceActiveObject;

ContainerWindow.QueryControl(IID_IOleInPlaceActiveObject, (LPVOID*)&spInPlaceActiveObject);

if (spInPlaceActiveObject)
{
HRESULT hr;
//*******************************************************
// This returns "Incorrect Function" on NT
hr = spInPlaceActiveObject->TranslateAccelerator(pMsg);
return hr;
}
}

return S_FALSE;
}
QuestionHow to set READONLY attrib on a directory. Pin
Henrik18-Apr-01 11:07
Henrik18-Apr-01 11:07 
GeneralNotice about ActiveX ... Pin
Hadi Rezaee18-Apr-01 7:26
Hadi Rezaee18-Apr-01 7:26 
GeneralHide window Pin
18-Apr-01 7:08
suss18-Apr-01 7:08 
GeneralRe: Hide window Pin
Hadi Rezaee18-Apr-01 7:23
Hadi Rezaee18-Apr-01 7:23 
GeneralRe: Hide window Pin
Ghasrfakhri18-Apr-01 10:39
Ghasrfakhri18-Apr-01 10:39 
GeneralRe: I'm curious.... Pin
Masaaki Onishi18-Apr-01 16:08
Masaaki Onishi18-Apr-01 16:08 
GeneralRe: I'm curious.... Pin
18-Apr-01 19:11
suss18-Apr-01 19:11 
GeneralRe: I'm curious.... Pin
18-Apr-01 23:26
suss18-Apr-01 23:26 
GeneralHelp: DLL thread Pin
18-Apr-01 6:12
suss18-Apr-01 6:12 
GeneralRe: Help: DLL thread Pin
18-Apr-01 10:40
suss18-Apr-01 10:40 
GeneralRe: Help: DLL thread Pin
Michael Dunn18-Apr-01 15:05
sitebuilderMichael Dunn18-Apr-01 15:05 
GeneralGet string without CSDIFormView ... Pin
Hadi Rezaee18-Apr-01 5:09
Hadi Rezaee18-Apr-01 5:09 
GeneralRe: Get string without CSDIFormView ... Pin
Masaaki Onishi18-Apr-01 15:58
Masaaki Onishi18-Apr-01 15:58 
GeneralRe: Get string without CSDIFormView ... Pin
Hadi Rezaee19-Apr-01 0:12
Hadi Rezaee19-Apr-01 0:12 
QuestionHow to send a 'refresh' message to MS-Dev from an another MFC application Pin
EiSl18-Apr-01 3:14
EiSl18-Apr-01 3:14 
GeneralCListCtrl Sorting Pin
Mustafa Demirhan18-Apr-01 3:07
Mustafa Demirhan18-Apr-01 3:07 
GeneralRe: CListCtrl Sorting Pin
18-Apr-01 19:14
suss18-Apr-01 19:14 

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.