Jump to content
Software FX Community

Re: GetExtension not working


User (Legacy)
 Share

Recommended Posts

Good morning! 

I use the following code:

// variable declaration

IAnnListPtr pAnnList;

_bstr_t annotation = "AnnotationX.AnnList";

// creation

pAnnList.CreateInstance(__uuidof(AnnotationX));

HRESULT rs = chartfx->AddExtension((IUnknown *)pAnnList);

// retrieval

chartfx->raw_GetExtension(annotation, (IUnknown **) &pAnnList);

Maybe it has something to do with calling the string in the actual

getextension call. Try _bstr_t.

HTH

--

josh

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

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

> I can't get the GetExtension function to work. Can you tell me what I am

> doing wrong?

>

> Sample code: (Using VC++, DLL, Latest service pack)

>

> // Add the annotation extension

> IAnnListPtr pAnnList;

> pAnnList.CreateInstance(__uuidof(AnnotationX));

> pChart->AddExtension((IUnknown*)pAnnList);

>

> // Now try getting it back.

> LPUNKNOWN pList;

> HRESULT HR = pChart->raw_GetExtension("AnnotateX.AnnList", &pList);

>

> HR now contains CO_E_CLASSSTRING ("Invalid class string.") I tried

> "AnnotationX.AnnList" as well, since I saw the other post in this

newgroup,

> but I get the same HRESULT. What string should I be using?

>

> Andrew Pane

> ---------------------------------------

> Merak Projects Ltd.

> A Division of Schlumberger GeoQuest

> ---------------------------------------

>

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...