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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What after GetActiveObject( …. ) ?

Status
Not open for further replies.

d00ape

Programmer
Apr 2, 2003
171
SE
I’m trying to get a handle to an wrapped ActiveX class like this:
(The ActiveX is running inside AutoCad.)

_DDataBaseTreeView *pPE; // the ActiveX class
HRESULT res;

CLSID clsid;

CLSIDFromProgID(L"NetModeler.DataBaseTreeView.1", &clsid);
IUnknown *pUnk = NULL;
IDispatch *pDisp = NULL;

HRESULT hr = GetActiveObject(clsid, NULL, (IUnknown**)&pPE);//pUnk);

if(SUCCEEDED(hr))
{
hr = pUnk->QueryInterface(IID_IDispatch, (void**)&pDisp );
if( SUCCEEDED(hr) )
{
// this happens if the ActiveX is running!!
}

}

_variant_t var;

//pPE->AttachDispatch( pDisp );

var = pPE->Func(); // CRACH!!!!!!!!!!!!

What have I missed?

I want to have a handle to an already running ActiveX inside AutoCad.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top