Click here to Skip to main content
15,899,025 members
Home / Discussions / COM
   

COM

 
GeneralRe: transfer block-memory in com ,why only a byte Pin
Pros Chum12-May-01 12:15
Pros Chum12-May-01 12:15 
GeneralRe: transfer block-memory in com ,why only a byte Pin
12-May-01 19:49
suss12-May-01 19:49 
GeneralMFC ActiveX & VBScript access Pin
Matt Weagle8-May-01 20:11
Matt Weagle8-May-01 20:11 
GeneralRe: MFC ActiveX & VBScript access Pin
Matt Weagle9-May-01 8:01
Matt Weagle9-May-01 8:01 
GeneralCOM help Pin
8-May-01 13:08
suss8-May-01 13:08 
GeneralRe: COM help Pin
Michael Dunn8-May-01 15:37
sitebuilderMichael Dunn8-May-01 15:37 
GeneralRe: COM help Pin
Dhanush29-May-01 23:19
professionalDhanush29-May-01 23:19 
GeneralPassing CComPtr into function properly Pin
8-May-01 11:10
suss8-May-01 11:10 
Warning: COM newbie...

If I do all the code inline, no problems. Inside the function, everything works fine also. The moment it returns, pMyObj gets set to NULL (Like it's going out of scope?) What have I missed here, and how can I fix it such that I pass in a CComPtr and have it setup inside the function, but still valid outside the function (i.e. not reset to NULL)?

NB: Angle brackets converted to square brackets coz they were being treated as HTML.

BOOL DoStuff( CComPtr[IMyObj] pMyObj ); // Declaration

BOOL DoStuff( CComPtr[IMyObj] pMyObj ) // Definition
{
hr = pMyObj.CoCreateInstance( CLSID_MyObj );
if( FAILED( hr ) return FALSE;
return TRUE
}

void MyDlg::MyFunc( void )
{
CComPtr[IMyObj] pMyOutsideObj; // Usage
if( !DoStuff( pMyOutsideObj ) )
return;
}


GeneralRe: Passing CComPtr into function properly Pin
Michael Dunn8-May-01 13:00
sitebuilderMichael Dunn8-May-01 13:00 
GeneralCalls to disconnected servers cause massive delays to system! Pin
7-May-01 23:58
suss7-May-01 23:58 
GeneralVARIANT_DATE help Pin
7-May-01 22:54
suss7-May-01 22:54 
QuestionHow to implement custom marshaling? Pin
fir20006-May-01 16:24
fir20006-May-01 16:24 
Generalcreate the com-object from the exe-server Pin
6-May-01 4:40
suss6-May-01 4:40 
GeneralRe: create the com-object from the exe-server Pin
6-May-01 7:39
suss6-May-01 7:39 
GeneralRe: create the com-object from the exe-server Pin
6-May-01 20:35
suss6-May-01 20:35 
GeneralRe: create the com-object from the exe-server Pin
7-May-01 11:02
suss7-May-01 11:02 
GeneralRe: create the com-object from the exe-server Pin
Pros Chum11-May-01 9:59
Pros Chum11-May-01 9:59 
Generalconnection points of custom event in exe Pin
5-May-01 17:48
suss5-May-01 17:48 
GeneralCOM threading question... Pin
Amit Dey4-May-01 5:50
Amit Dey4-May-01 5:50 
GeneralATL COM Service Install Trouble Pin
Garth J Lancaster3-May-01 21:07
professionalGarth J Lancaster3-May-01 21:07 
GeneralRe: ATL COM Service Install Trouble Pin
Garth J Lancaster4-May-01 14:38
professionalGarth J Lancaster4-May-01 14:38 
GeneralRe: ATL COM Service Install Trouble Pin
Garth J Lancaster7-May-01 0:05
professionalGarth J Lancaster7-May-01 0:05 
GeneralRe: ATL COM Service Install Trouble Pin
7-May-01 11:09
suss7-May-01 11:09 
GeneralRe: ATL COM Service Install Trouble Pin
Garth J Lancaster8-May-01 14:38
professionalGarth J Lancaster8-May-01 14:38 
General_ATL_MIN_CRT Pin
SuperGeek1-May-01 13:36
SuperGeek1-May-01 13:36 

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.