User (Legacy) Posted June 5, 2000 Report Share Posted June 5, 2000 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); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.