Click here to Skip to main content
15,881,852 members
Home / Discussions / COM
   

COM

 
GeneralRe: Save a CArray into the persistence of a ActiveX Pin
ZeroCoolLP19-Jan-04 0:34
ZeroCoolLP19-Jan-04 0:34 
QuestionPossible to dvlp COM/ATL C++ code in VS.NET? Pin
michael thomas17-Jan-04 11:28
michael thomas17-Jan-04 11:28 
AnswerRe: Possible to dvlp COM/ATL C++ code in VS.NET? Pin
Amit Dey24-Jan-04 11:47
Amit Dey24-Jan-04 11:47 
Generalproblem with __uuidof Pin
emmatty17-Jan-04 0:04
emmatty17-Jan-04 0:04 
GeneralRe: problem with __uuidof Pin
Abhishek Srivastava18-Jan-04 17:17
Abhishek Srivastava18-Jan-04 17:17 
GeneralRe: problem with __uuidof Pin
Anonymous30-Jan-04 11:09
Anonymous30-Jan-04 11:09 
GeneralRelease in thread created by timer Pin
Steve Schaneville15-Jan-04 17:39
professionalSteve Schaneville15-Jan-04 17:39 
GeneralRe: Release in thread created by timer Pin
Jörgen Sigvardsson15-Jan-04 21:58
Jörgen Sigvardsson15-Jan-04 21:58 
How about using CreateEvent/SetEvent/WaitForSingleObject/SignalObjectAndWait?

Create two events before the worker starts, one called "StopNow" and "DidStop". Let the worker thread do it's thing, periodically checking the "StopNow" event with WaitForSingleObject. When your server is about to terminate, make it use the function SignalObjectAndWait. This'll set the "StopNow" event, thus triggering the worker thread. It'll also make the server wait for the "DidStop" event. Meanwhile, the thread exits gracefully, but before finally quitting, it sets the event "DidStop", which will give the main thread clearance to continue termination.

// Server code
void OnTerminate() {
   SignalObjectAndWait(hStopNow, hDidStop, INFINITE, FALSE);
   ...
}
  
// Worker thread
void ThreadProc() {
   while(...) {
      ...
      if(WaitForSingleObject(hStopNow, 0)) {
         SetEvent(hDidStop);
         // clean up and exit         
      }
   }
}


--
Seraphim Shock. Gold for your ears.
GeneralRe: Release in thread created by timer Pin
Steve Schaneville16-Jan-04 12:20
professionalSteve Schaneville16-Jan-04 12:20 
QuestionBig difference between VB new operator and COM CoCreateInstance? Pin
Brigsoft15-Jan-04 9:54
Brigsoft15-Jan-04 9:54 
AnswerRe: Big difference between VB new operator and COM CoCreateInstance? Pin
Anonymous30-Jan-04 11:18
Anonymous30-Jan-04 11:18 
QuestionHow to fill the fields of IE's web page from within VB or C++ ? Pin
John Thomas15-Jan-04 6:10
John Thomas15-Jan-04 6:10 
AnswerRe: How to fill the fields of IE's web page from within VB or C++ ? Pin
Amit Dey24-Jan-04 11:51
Amit Dey24-Jan-04 11:51 
GeneralProblems with out of process server (COM) Pin
Anonymous15-Jan-04 0:26
Anonymous15-Jan-04 0:26 
GeneralRe: Problems with out of process server (COM) Pin
Mike Dimmick15-Jan-04 2:34
Mike Dimmick15-Jan-04 2:34 
GeneralRe: Problems with out of process server (COM) Pin
Omar Alvi15-Jan-04 8:13
Omar Alvi15-Jan-04 8:13 
GeneralRe: Problems with out of process server (COM) Pin
Anonymous30-Jan-04 11:26
Anonymous30-Jan-04 11:26 
GeneralInside Ole Kraig BrockSchmidt, samples needed Pin
safee ullah13-Jan-04 23:35
safee ullah13-Jan-04 23:35 
GeneralWord Component Object Model Pin
Anonymous13-Jan-04 1:51
Anonymous13-Jan-04 1:51 
GeneralRe: Word Component Object Model Pin
Michael P Butler13-Jan-04 2:10
Michael P Butler13-Jan-04 2:10 
GeneralRe: Word Component Object Model Pin
Anonymous13-Jan-04 3:39
Anonymous13-Jan-04 3:39 
QuestionHow to get IStream on ordinary file ? Pin
vipsy12-Jan-04 22:11
vipsy12-Jan-04 22:11 
AnswerRe: How to get IStream on ordinary file ? Pin
Jörgen Sigvardsson13-Jan-04 9:39
Jörgen Sigvardsson13-Jan-04 9:39 
GeneralRe: How to get IStream on ordinary file ? Pin
vipsy13-Jan-04 17:58
vipsy13-Jan-04 17:58 
GeneralRe: How to get IStream on ordinary file ? Pin
Jörgen Sigvardsson13-Jan-04 21:48
Jörgen Sigvardsson13-Jan-04 21:48 

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.