|
Ian Bowler wrote: The ActiveX control is not added at design time. It is dynamically created.
You still have to implement the event sink which means that you need to know how the sink interface is defined.
The easiest way is to add the control to the project at design time and use ClassWizard to generate the event sink.
When you 'hook it up' you have to use IConnectionPointContainer and IConnectionPoint interfaces and in the end call IConnectionPoint::Advise and provide an interface pointer to the sink.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
Thanks. I'll look into this method.
still... this is extremely common right? It seems like there should be an easier way. Something through class wizard..?
|
|
|
|
|
I want to create a Window witch is always on bottom z order, in fact this window is my "desktop" with some "buttons" , and these buttons launch some other applications. But the "desktop window" can hide the launched applications
Some body could help me
Thanks a lot in advance
Christian
|
|
|
|
|
Look at the Windows MFC site for the description of the SetWindowPos() function, you can understand it from there, I am sure.
|
|
|
|
|
How do you change the little icon picture in the title bar of a CDialog window?
Heather
|
|
|
|
|
you have to change the IDR_MAINFRAME resource with the new icon (still in OnInitDialog())...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|
|
SetIcon()
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
True, a secondary thread might not even have a message pump.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
How do you dynamically change the caption title in .NET for a CDialog window?
Heather Heiman
|
|
|
|
|
CDialog is not a .NET class, but a MFC one.
i so consider you're using MFC.
you simply have to do this :
this->SetWindowText("new caption");
in a function of your dialog class...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|
|
I tried that line of code, but it doesn't seem to do anything. I even called UpdateData to see if that would work. I'm calling SetWindowText in OnInitDialog. Is there another place I should call it?
Heather
|
|
|
|
|
there's no need to call UpdateData() if you use pointer (here, this ).
you might be doing something wrong because it works fine for me (according you call it into OnInitDialog(), not into the dialog constructor)...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|
|
I got it to work. Thanks.
Heather
|
|
|
|
|
and what was the missing point ??
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|
|
I had the SetWindowText call in the wrong function. I put it in OnInitDialog and it worked fine.
Heather
|
|
|
|
|
I have a windows message problem that has haunted me for a long time.
Suppose one application has two thread. Thread A "sends" and "posts" message
to a window handle in thread B.
Thread A
{
LOOP{
...
SendMessage(m_hwnd, msg1);
...
PostMessage(m_hwnd, msg2);
...
}
}
in winproc of Thread B:
Winproc
{
case (msg1): do something
...
case (msg2): do something
...
}
my question is: if Thread B is processing msg2, and Thread A are going to
send msg1 , Thread A will wait until Thread B finishes processing msg2??
|
|
|
|
|
The very definition of SendMessage() says that control does not return until the window procedure (the one in thread B) has processed the message. If this is a problem, use SendMessageTimeout() instead.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi David,does that mean: Thread B will always process msg1 then msg2 ,again and again? it could not process two continous msg2?? However, I found in my project,
this situation happens, but not often!
-- modified at 11:54 Wednesday 7th December, 2005
|
|
|
|
|
No.
Thread B will process msg1 and the SendMessage call in Thread A will only return when Thread B has finished processing.
Then Thread A will Post msg2 but the PostMessage call will return immediately without waiting for Thread B to process it.
Then it may be possible for Thread A to return to the top of the loop and send another msg1 while Thread B is still processing msg2.
That is precisely the way SendMessage and PostMessage are designed: SendMessage waits for processing, PostMessage doesn't wait.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
jinzhecheng wrote: my question is: if Thread B is processing msg2, and Thread A are going to
send msg1 , Thread A will wait until Thread B finishes processing msg2??
Offcourse... Thread B should finish previous Message Processing before taking new task...
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Sir
Can any help me in knowing which message is fired
when Windows is
1)about to Shutdown?
2)when we press F1;
3)when we click on Shutdown among 3 options
ie; restart,shutdown,standby.
i am waiting 4 u reply , i have this doubt form many days thank u for helping me in order to understand vc++ msgs.
bye
Satishvarma.E
|
|
|
|
|
Intercepting the Ctrl+Alt+Del sequence is not a trivial task. To do it effectively requires a good knowledge of GINA.
When Windows is being shut down or restarted, it will send a WM_QUERYENDSESSION to each top-level window. Handle that message accordingly.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: When Windows is being shut down or restarted, it will send a WM_QUERYENDSESSION to each top-level window.
I see this answer quite often when it comes to questions about system shutdown/logoff so I want to clarify something. I have always been under the impression that the message to handle for system shutdown is WM_ENDSESSION not WM_QUERYENDSESSION . Query just asks the running apps if it is ok to shut down the system at this time, it makes no guarantees that the system is actually shutting down. If you close your app when it recieves the query it may end up being closed when the system is not shut down, leaving the user confused as to why the app closes on it's own for some unknown reason. Or am I misreading what it says in MSDN?
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote: Or am I misreading what it says in MSDN?
Your comprehension is fine. Most folks ask the question in a general sense. In this case, I usually direct them to WM_QUERYENDSESSION where they can then (hopefully) find WM_ENDSESSION , too.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I am trying to specify the paper tray / bin from which to print a document. I am using the DEVMODE structure and a call to CreateDC(). My other DEVMODE attributes work perfect, but no matter what I do, I cannot get the document to print from a different tray.
Code snippet here:
...
devMode.dmDefaultSource = this->tray; /* number between 1 and 15 */
devMode.dmFields = devMode.dmFields | DM_DEFAULTSOURCE;
return CreateDC(NULL, inPrinter, NULL, &devMode);
}
This has been driving me crazy for too long.
Any help is appreciated.
Craig
|
|
|
|