Click here to Skip to main content
16,010,334 members
Home / Discussions / COM
   

COM

 
GeneralRe: SmartPointers and COM+ Pin
pba_14-Mar-02 5:43
pba_14-Mar-02 5:43 
Generaltype library not seen in OLE COM Object Viewer Pin
11-Mar-02 19:15
suss11-Mar-02 19:15 
GeneralRe: type library not seen in OLE COM Object Viewer Pin
pba_14-Mar-02 5:22
pba_14-Mar-02 5:22 
GeneralGUID in COM Pin
Leesen11-Mar-02 14:30
Leesen11-Mar-02 14:30 
GeneralRe: GUID in COM Pin
soptest11-Mar-02 15:08
soptest11-Mar-02 15:08 
GeneralRe: GUID in COM Pin
Derek Waters11-Mar-02 15:52
Derek Waters11-Mar-02 15:52 
GeneralTab key not working Pin
manjunatha.s8-Mar-02 20:23
manjunatha.s8-Mar-02 20:23 
GeneralRe: Tab key not working Pin
kakarlamudikrishnarao10-Mar-02 21:10
kakarlamudikrishnarao10-Mar-02 21:10 
Hi ,
I also faced the same problem a year back in not for a ATL but in a Hidden ACtiveX which has a DialogBOX inside the ActiveX -

Problem is - The ActiveX or ATL Control doesnt has its own message queueso pretranslate message doesnt come to it at all - The control is with the parent window so all the WM_KEYDOWN messages routed to the parent window. I had a small work around - I had the pretranslate message of Parent Container window overridden and got the Window Handle of the Message source and then set the focus to the desired Target window. This is a very immature and primitive solution - then when i posted it in code guru i had this solution after 1 year Smile | :) though its effective - take a look into it and lemme know if u are able to solve the problem

Below is my post - so u can have the whole thread
---------------------------------------------------------------------------------------------------
Hi I have a peculiar problem ,i used the method of creating mainframes and dialogs inside a dll , but i created them inside a activeX control (invisible one) and below is the problem .

Thanx
Bush

Problem :

We have developed 2 activex conrols using the activex wizard from MSVC++ 6.0 SP3.
The architecture of the ocx is as below :

ActiveX A-
This is developed with DocView architecture in mind (Microsoft MIND magazine article 1996-97).But slightly modified for creating a complete mainframe application inside a invisible OCX control.Interfaces are written for creating and showing the application through the ole control.In design time we have placed the control inside a MFC dialog based application and generated a wrapper class for it and are able to create and show the Mainframe application inside the ocx.Problem comes when we there is a ALT+anykey combination on the application.The ole conrol
just hangs for ever,also it hangs the whole application.We were able to get to a point where we see exactly which message is fired and tried to handle the same by handling pretranslate message of the mainframe inside the control and doing a PeekMessage and PM_REMOVE from the message Q for a quick workaround.But it didnt work.The app still hangs.

ActiveX B -
This is similar to the ActiveX A but is a dialog application.

Functionally they are wokring absoulutely fine except for the ALT+ANYKEY combination where the application from the activeX just hangs.

PS:The dialog's or the mainframes PretranslateMesage is just not getting called.
---------------------------------------------------------------------------------------------------

This was posted by Aditya Roy on codeguru to my comment regarding the above problem . Please not this was for my activeX with a MFC Dialog in it - this should be the same case as urs - so check it out and see if this helps

---------------------------------------------------------------------------------------------------
The reason for it -
ActiveX's do not have its message queue, the host container's Queue is used. So all key messages are taken by the container as your dialog is probably non modal.

Solution -

1. Make a Static function called hpMsgProc

LRESULT CALLBACK hpTest::hpMsgProc(int nCode, WPARAM wParam, LPARAM lParam)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
LPMSG lpMsg = (LPMSG) lParam;
if( (nCode >= 0) && PM_REMOVE == wParam && (lpMsg->message >= WM_KEYFIRST && lpMsg->message <= WM_KEYLAST) && AfxGetApp()->PreTranslateMessage((LPMSG)lParam) )
{
lpMsg->message = WM_NULL;
lpMsg->lParam = 0L;
lpMsg->wParam = 0;
}
return ::CallNextHookEx(hook, nCode, wParam, lParam);
}

2. Make a member variable called hook of type HHOOK.

3. In InitDialog, add

hook = ::SetWindowsHookEx(WH_GETMESSAGE,hpMsgProc,AfxGetInstanceHandle(),GetCurrentThreadId());

In Onclose, free it.

::UnhookWindowsHookEx (hook);


this should work.


-Roy
---------------------------------------------------------------------------------------------------

Regards

Bhushan
GeneralDCOM configuration Pin
pépé6-Mar-02 23:05
pépé6-Mar-02 23:05 
GeneralSingleton COM object doesn't work on Service Pin
prachi6-Mar-02 1:30
prachi6-Mar-02 1:30 
GeneralRe: Singleton COM object doesn't work on Service Pin
soptest9-Mar-02 13:17
soptest9-Mar-02 13:17 
QuestionCOM, DCOM and COM+...? What's the difference? Pin
Tommy Svensson5-Mar-02 2:49
Tommy Svensson5-Mar-02 2:49 
AnswerRe: COM, DCOM and COM+...? What's the difference? Pin
Mazdak5-Mar-02 2:53
Mazdak5-Mar-02 2:53 
GeneralRe: COM, DCOM and COM+...? What's the difference? Pin
Amit Dey6-Mar-02 6:17
Amit Dey6-Mar-02 6:17 
GeneralRe: COM, DCOM and COM+...? What's the difference? Pin
Mazdak6-Mar-02 8:13
Mazdak6-Mar-02 8:13 
GeneralNewbie looking for COM start out resources! Pin
Tommy Svensson5-Mar-02 1:22
Tommy Svensson5-Mar-02 1:22 
GeneralRe: Newbie looking for COM start out resources! Pin
Michael P Butler5-Mar-02 1:26
Michael P Butler5-Mar-02 1:26 
GeneralRe: Newbie looking for COM start out resources! Pin
Tommy Svensson5-Mar-02 1:35
Tommy Svensson5-Mar-02 1:35 
GeneralRe: Newbie looking for COM start out resources! Pin
Joao Vaz5-Mar-02 2:39
Joao Vaz5-Mar-02 2:39 
GeneralRe: Newbie looking for COM start out resources! Pin
Tommy Svensson5-Mar-02 2:46
Tommy Svensson5-Mar-02 2:46 
GeneralRe: Newbie looking for COM start out resources! Pin
Michael Dunn5-Mar-02 6:27
sitebuilderMichael Dunn5-Mar-02 6:27 
GeneralRe: Newbie looking for COM start out resources! Pin
Tommy Svensson5-Mar-02 22:21
Tommy Svensson5-Mar-02 22:21 
GeneralRe: Newbie looking for COM start out resources! Pin
Michael Dunn6-Mar-02 7:39
sitebuilderMichael Dunn6-Mar-02 7:39 
GeneralRe: Newbie looking for COM start out resources! Pin
Tommy Svensson6-Mar-02 22:07
Tommy Svensson6-Mar-02 22:07 
GeneralRe: Newbie looking for COM start out resources! Pin
Michael Dunn6-Mar-02 22:14
sitebuilderMichael Dunn6-Mar-02 22: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.