Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why GetActiveObject fail?

Status
Not open for further replies.

Ocean

Programmer
Oct 12, 2000
4
US
Here is the code that gave me trouble:

UUID uuid1;
RPC_STATUS rpcStatus;

rpcStatus = UuidFromString( (UCHAR*) "5C407353-215D-11D0-9929-080036180F02",&uuid1);
if ( rpcStatus != RPC_S_OK )
{
AfxMessageBox("CLSID Failed");
return FALSE;
}

HRESULT hr=0;
IUnknown *punk ;
IDispatch *dispatch;

hr = GetActiveObject(uuid1,NULL,&punk);
CString CsMessage;
CsMessage.Format("%d",hr);
AfxMessageBox(CsMessage);

After program was run, I got a big negative number for hr. Any help will be appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top