Jump to content
Software FX Community

Re: GetExtension not working


User (Legacy)

Recommended Posts

Actually, it looks like raw_GetExtension receieves a char pointer (LPSTR), 

not a BSTR.

I tried just about everything: CString, BSTR, character array, etc. and I

always got the same error code. I copied in the code Josh posted verbatim

and I still got the same thing. I created a small sample app and tried

everything but with no difference in results (the code I used is at the end

of this e-mail.)

I'm stumped. I've got all the latest versions of the DLL's registered.

(I'm acutally trying to use GetExtension as a workaround for another problem

I'm having. I'll post that problem in a new thread...)

Andrew

-------------

CoInitialize(NULL);

// Create the chart

IChartFX* _pChartFX;

IClassFactory2* piLicense = NULL;

BSTR bstrLicense =

:SysAllocString( OLESTR("DontBeCopyingMyLicenseString!") );

// Create the a chart with the license key.

HRESULT hr = ::CoGetClassObject( __uuidof( ChartFX ),

CLSCTX_INPROC_SERVER,

NULL,

IID_IClassFactory2,

reinterpret_cast<void**>(&piLicense) );

hr = piLicense->CreateInstanceLic( NULL,

NULL,

__uuidof( IChartFX ),

bstrLicense,

reinterpret_cast<void**>(&_pChartFX) );

piLicense->Release();

::SysFreeString( bstrLicense );

IAnnListPtr pAnnList;

_bstr_t annotation = "AnnotationX.AnnList";

// creation

pAnnList.CreateInstance(__uuidof(AnnotationX));

hr = _pChartFX->AddExtension((IUnknown *)pAnnList);

// retrieval

hr = _pChartFX->raw_GetExtension(annotation, (IUnknown **) &pAnnList);

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...