Jump to content
Software FX Community

Re: GetExtension not working


User (Legacy)
 Share

Recommended Posts

Hey Andrew, 

I tried your code exactly in my app and it works okay (pops up annotation

tool bar and returns pAnnList as something other than NULL)... sorry- i

know thats no help to you except to say you're doing it right... is there

any chance you dont have the latest versions of chartfx?

hth josh

"Andrew Pane" <apane@merak.com> wrote in message

news:DE0379D14694D211B4CE00609770710D0560A5@sftfx-221.wamnet.net...

> 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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...