Click here to Skip to main content
15,917,862 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish7-Aug-08 6:45
Kiran Satish7-Aug-08 6:45 
AnswerRe: Help on Multi-Threaded applicaiton Pin
Simon Cooke15-Oct-08 21:52
Simon Cooke15-Oct-08 21:52 
GeneralRe: Help on Multi-Threaded applicaiton Pin
Kiran Satish6-Aug-08 13:33
Kiran Satish6-Aug-08 13:33 
QuestionGet Running Application's Main Window Pin
vikrant kpr27-Jun-08 12:22
vikrant kpr27-Jun-08 12:22 
Questionwinsock2 recv() returns empty buffer, but correct number of bytes received Pin
Member 427345427-Jun-08 11:14
Member 427345427-Jun-08 11:14 
AnswerRe: winsock2 recv() returns empty buffer, but correct number of bytes received Pin
Mark Salsbery28-Jun-08 11:15
Mark Salsbery28-Jun-08 11:15 
QuestionOLE Automation server's knowledge of client(s) Pin
garyflet27-Jun-08 6:11
garyflet27-Jun-08 6:11 
AnswerRe: OLE Automation server's knowledge of client(s) Pin
Roger Stoltz27-Jun-08 7:42
Roger Stoltz27-Jun-08 7:42 
garyflet wrote:
How does the server know which clients, if any, are still attached?


I may be misinterpreting your question, but this is done by reference counting.
The server will in general not know anything about its clients, it only knows that it has one or more clients attached to it.


garyflet wrote:
When my automation client calls COleDispatchDriver::ReleaseDispatch(), thus releasing the server, the server receives a WM_CLOSE message. If there are other clients still connected, the server,if visible, is supposed to display a message to that effect and offer to close.


From your question I assume you're talking about an application that runs as an out-of-process COM server. I wouldn't expect the server to close, or even the WM_CLOSE message being sent, unless the reference count reaches zero. Popping a dialogue asking the user whether to shut down the server or not seems a bit odd since there shouldn't be any clients left.


garyflet wrote:
If invisible, the server simly doesn't close.


Confused | :confused:
Don't quite get what you mean by this, but when a server shuts down and calls ::CoUninitialize it tries to dispatch all pending COM calls in a message loop. A server may hang inside this loop if the server hasn't released all COM servers it may have created.
Your problem may be related to this, or it may be popping an invisible dialogue box waiting for user input.

I think you need to explain your problem a bit further and what you're trying to do.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


QuestionRe: OLE Automation server's knowledge of client(s) Pin
garyflet27-Jun-08 8:27
garyflet27-Jun-08 8:27 
AnswerRe: OLE Automation server's knowledge of client(s) Pin
Roger Stoltz30-Jun-08 1:31
Roger Stoltz30-Jun-08 1:31 
Questionerror appear Pin
sofia_11127-Jun-08 5:32
sofia_11127-Jun-08 5:32 
AnswerRe: error appear Pin
led mike27-Jun-08 5:37
led mike27-Jun-08 5:37 
GeneralRe: error appear [modified] Pin
sofia_11127-Jun-08 7:03
sofia_11127-Jun-08 7:03 
QuestionRe: error appear Pin
CPallini27-Jun-08 9:40
mveCPallini27-Jun-08 9:40 
AnswerRe: error appear Pin
sofia_11127-Jun-08 12:54
sofia_11127-Jun-08 12:54 
AnswerRe: error appear Pin
Hamid_RT30-Jun-08 18:30
Hamid_RT30-Jun-08 18:30 
QuestionExtending Exchange Server Pin
Steve Thresher27-Jun-08 3:38
Steve Thresher27-Jun-08 3:38 
AnswerRe: Extending Exchange Server Pin
led mike27-Jun-08 5:35
led mike27-Jun-08 5:35 
QuestionRemoving tab spaces using C++ source code Pin
Nandu_77b27-Jun-08 1:59
Nandu_77b27-Jun-08 1:59 
AnswerRe: Removing tab spaces using C++ source code Pin
CPallini27-Jun-08 2:10
mveCPallini27-Jun-08 2:10 
QuestionRe: Removing tab spaces using C++ source code Pin
Nandu_77b27-Jun-08 2:46
Nandu_77b27-Jun-08 2:46 
QuestionRe: Removing tab spaces using C++ source code Pin
SandipG 27-Jun-08 2:52
SandipG 27-Jun-08 2:52 
AnswerRe: Removing tab spaces using C++ source code Pin
Roger Stoltz27-Jun-08 3:09
Roger Stoltz27-Jun-08 3:09 
AnswerRe: Removing tab spaces using C++ source code Pin
Nandu_77b27-Jun-08 3:11
Nandu_77b27-Jun-08 3:11 
GeneralRe: Removing tab spaces using C++ source code Pin
SandipG 27-Jun-08 3:18
SandipG 27-Jun-08 3:18 

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.