Click here to Skip to main content
15,907,875 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionUsing CSplitterWindow with MFC? Pin
Roozbeh6923-Apr-04 21:45
professionalRoozbeh6923-Apr-04 21:45 
Generalgetting Interface pointer for control created by AtlAxCreateControl Pin
Abhi Lahare22-Apr-04 19:40
Abhi Lahare22-Apr-04 19:40 
GeneralRe: getting Interface pointer for control created by AtlAxCreateControl Pin
f6426-Apr-04 12:48
f6426-Apr-04 12:48 
GeneralMail Filter Pin
Leandro H. Delamare22-Apr-04 17:53
Leandro H. Delamare22-Apr-04 17:53 
QuestionMessage for invisible control ? Pin
Sebastian S.22-Apr-04 3:34
Sebastian S.22-Apr-04 3:34 
AnswerRe: Message for invisible control ? Pin
f6422-Apr-04 15:09
f6422-Apr-04 15:09 
GeneralRe: Message for invisible control ? Pin
Sebastian S.22-Apr-04 22:14
Sebastian S.22-Apr-04 22:14 
GeneralRe: Message for invisible control ? Pin
f6423-Apr-04 13:30
f6423-Apr-04 13:30 
Hi I think I'm starting to understand what you are trying to do.
The fact of having several objects hosted on IE is irrelevant to your
problem, isn't it?
The real issue here is how to capture messages from a 3rd party package, am
I right?
So, let me ask you, is this 3rd party queueing system a COM based server or
not?, if it is so, it should communicate using event and not messages.
The article that you mentioned, "Firing Events among ActiveX Controls on the IE Browser", clearly talks about events and not messages.
If it is not a COM server, can you show me a piece of documentation how
it is suppose to communicate back to your code? I'm saying this because is
very unusual for a library to send messages to a client, usually this is
done through call back functions, so what you are saying sounds a litle odd.

Anyways, comments aside, here is how you can do the test you mentioned before.

First, declare the id of the message you will use.
Add this line to the stdafx.h file so it will be available to the whole project

//This is the declaration of the message id<br />
extern UINT UM_MYTESTMESSAGE;


now define its value.
Add this into your cpp file.

//Make sure this string is unique. <br />
//Usually the name of the massage plus the name of the application is enough.<br />
//The returning ID will be unique<br />
UINT UM_MYTESTMESSAGE = ::RegisterWindowMessage(_T("MyAppNameMyMessageName"));


Now how to capture the message, if your class derives directly or indirectly from a CWindowImpl it has a BEGIN_MSG_MAP macro, so add this line

BEGIN_MSG_MAP(CMyTest)<br />
    MESSAGE_HANDLER(UM_MYTESTMESSAGE, OnMyMessageTest)	//this is the one you add<br />
	... it may be something else here<br />
END_MSG_MAP()


Then you have to provide the OnMyMessageTest implementation, so add this
<br />
LRESULT OnMyMessageTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)<br />
{<br />
    MessageBox(_T("I got the message "));<br />
    return 0;<br />
};<br />

And last, somebody has to send the message to this window, and I think here is where you have the problem, answering your question, yes, messages can only be send to a valid window, if you got an assertion here

ATLASSERT(::IsWindow(m_hWnd));

is because you sent the message when the window was not yet created, so, choose a place where the window you are send the message to, has already been created, then add this line

::SendMessage(hWnd, UM_MYTESTMESSAGE, 0, 0);

hWnd is a valid handler to the window where the message will be processed.

I hope this helps you, if you need an example project, let me know and I'll email one to you.

Regards,
Fabian
GeneralRe: Message for invisible control ? Pin
Sebastian S.25-Apr-04 22:13
Sebastian S.25-Apr-04 22:13 
Generalhuge time difference between 1st and 2nd run of VC++ dynamic dll Pin
apratimg21-Apr-04 21:14
sussapratimg21-Apr-04 21:14 
GeneralRe: huge time difference between 1st and 2nd run of VC++ dynamic dll Pin
Dudi Avramov22-Apr-04 3:55
Dudi Avramov22-Apr-04 3:55 
QuestionNo Windows messages in ATL 7 ??? Pin
divinxu21-Apr-04 13:39
divinxu21-Apr-04 13:39 
AnswerRe: No Windows messages in ATL 7 ??? Pin
Jörgen Sigvardsson2-May-04 6:33
Jörgen Sigvardsson2-May-04 6:33 
GeneralActiveX event delay Pin
Dimitris Vasiliadis21-Apr-04 2:57
Dimitris Vasiliadis21-Apr-04 2:57 
GeneralAlign size of ActiveX control Pin
El'Cachubrey20-Apr-04 22:50
El'Cachubrey20-Apr-04 22:50 
GeneralRe: Align size of ActiveX control Pin
Balkrishna Talele20-Apr-04 23:01
Balkrishna Talele20-Apr-04 23:01 
GeneralCoGetObject and Nagging Dialog Pin
Balkrishna Talele20-Apr-04 22:48
Balkrishna Talele20-Apr-04 22:48 
Generalcreating multiple activeX.. Pin
Abhi Lahare20-Apr-04 19:33
Abhi Lahare20-Apr-04 19:33 
GeneralRe: creating multiple activeX.. Pin
Balkrishna Talele20-Apr-04 22:54
Balkrishna Talele20-Apr-04 22:54 
GeneralRe: creating multiple activeX.. Pin
Abhi Lahare21-Apr-04 1:33
Abhi Lahare21-Apr-04 1:33 
GeneralRe: creating multiple activeX.. Pin
Balkrishna Talele21-Apr-04 1:47
Balkrishna Talele21-Apr-04 1:47 
QuestionHow to use a WTL splitter window Pin
Roozbeh6920-Apr-04 10:16
professionalRoozbeh6920-Apr-04 10:16 
AnswerRe: How to use a WTL splitter window Pin
Senkwe Chanda20-Apr-04 22:20
Senkwe Chanda20-Apr-04 22:20 
GeneralActiveX properties in Visual Basic Pin
mikewithersone18-Apr-04 15:28
mikewithersone18-Apr-04 15:28 
GeneralRe: ActiveX properties in Visual Basic Pin
Mike Dimmick19-Apr-04 8:45
Mike Dimmick19-Apr-04 8:45 

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.