Click here to Skip to main content
15,920,383 members
Home / Discussions / COM
   

COM

 
GeneralRe: COM DLL instantiated twice Pin
Pascal Pinchauret-Lamothe6-Feb-05 20:41
Pascal Pinchauret-Lamothe6-Feb-05 20:41 
GeneralRe: COM DLL instantiated twice Pin
rwestgraham7-Feb-05 0:22
rwestgraham7-Feb-05 0:22 
GeneralRe: COM DLL instantiated twice Pin
Pascal Pinchauret-Lamothe7-Feb-05 21:33
Pascal Pinchauret-Lamothe7-Feb-05 21:33 
GeneralRe: COM DLL instantiated twice Pin
rwestgraham8-Feb-05 9:02
rwestgraham8-Feb-05 9:02 
GeneralRe: COM DLL instantiated twice Pin
Pascal Pinchauret-Lamothe8-Feb-05 10:57
Pascal Pinchauret-Lamothe8-Feb-05 10:57 
GeneralRe: COM DLL instantiated twice Pin
engrx221-Sep-07 5:41
engrx221-Sep-07 5:41 
GeneralQuestion about [in, out] parameters Pin
AndyCheetham4-Feb-05 2:43
AndyCheetham4-Feb-05 2:43 
GeneralRe: Question about [in, out] parameters Pin
Mike Dimmick7-Feb-05 0:00
Mike Dimmick7-Feb-05 0:00 
Use a ** when you want to pass a pointer to an object and you might want it to return a pointer to a different object. Consider:
HRESULT Select( System** pSystem )
{
   if ( pSystem != NULL )
      (*pSystem)->Release();

   *pSystem = new System();
}
 
pSystem = new System();
HRESULT hr = Select( &pSystem );
 
// pSystem now points to a different System object
If you don't want to change the value of the pointer you pass in, but instead change the value of the object, use a single *.

I think that you actually do want to pass the pointer by reference, but your ISystemPtr smart pointer class has an override of operator & which I assume is releasing the held pointer. Without seeing this class, or what the typedef is, it's difficult to help.

The documentation for _com_ptr_t, the environment's own smart pointer, suggests that operator&[^] releases the pointer then NULLs it. IIRC, using #import generates smart pointer typedefs of _com_ptr_t.

If this is what you're using, I think all you can do is Detach the pointer, call Select, then Attach the resulting pointer to the smart pointer object.

ATL's CComPtr allows direct access to the raw pointer through the public p member. Its operator& ASSERTs if the contained pointer is not NULL.

Stability. What an interesting concept. -- Chris Maunder
GeneralRe: Question about [in, out] parameters Pin
Jörgen Sigvardsson8-Feb-05 9:55
Jörgen Sigvardsson8-Feb-05 9:55 
GeneralCOM + several classes Pin
Geert van Horrik3-Feb-05 22:52
Geert van Horrik3-Feb-05 22:52 
GeneralCom components Pin
masud_masud3-Feb-05 4:25
masud_masud3-Feb-05 4:25 
QuestionATL ActiveX - How to create the own Property Page? Pin
out_of_life3-Feb-05 0:02
out_of_life3-Feb-05 0:02 
AnswerRe: ATL ActiveX - How to create the own Property Page? Pin
out_of_life4-Feb-05 1:54
out_of_life4-Feb-05 1:54 
GeneralRTD (real Time Data) problem Pin
aswanee2-Feb-05 2:02
aswanee2-Feb-05 2:02 
General"A Tool returned Error" Pin
Hariharan.T1-Feb-05 21:31
Hariharan.T1-Feb-05 21:31 
General0x8000401a - The server process could not be started because the configured identity is incorrect. Check the username and password. Pin
ohadp1-Feb-05 20:48
ohadp1-Feb-05 20:48 
GeneralDeriving a class from more than one interface Pin
Steve Thresher31-Jan-05 23:24
Steve Thresher31-Jan-05 23:24 
GeneralRe: Deriving a class from more than one interface Pin
AndyCheetham4-Feb-05 3:00
AndyCheetham4-Feb-05 3:00 
GeneralSink implementation Pin
Hariharan.T31-Jan-05 0:26
Hariharan.T31-Jan-05 0:26 
QuestionHow to open the default browser ? Pin
lasterix28-Jan-05 0:48
lasterix28-Jan-05 0:48 
AnswerRe: How to open the default browser ? Pin
ThatsAlok28-Jan-05 18:17
ThatsAlok28-Jan-05 18:17 
GeneralRe: How to open the default browser ? Pin
lasterix29-Jan-05 21:25
lasterix29-Jan-05 21:25 
GeneralRe: How to open the default browser ? Pin
ThatsAlok8-Feb-05 19:39
ThatsAlok8-Feb-05 19:39 
AnswerRe: How to open the default browser ? Pin
User 21559731-Jan-05 19:16
User 21559731-Jan-05 19:16 
GeneralRe: How to open the default browser ? Pin
lasterix1-Feb-05 2:12
lasterix1-Feb-05 2:12 

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.