Board index » cppbuilder » Smart pointers with cppbuilder 4 (Import Type Library)

Smart pointers with cppbuilder 4 (Import Type Library)

Hello together,

I want to import the type library of msxml with Borland CPP-Builder 4.
It works, but I get only raw interfaces not smart pointers, I want to
work with.

Does anybody know, how to get smart pointers with CPPB4? Does CPPB4
supports smart pointers. I know in CPPB5 it works.

I would be glad, if it is possible, if someone could explain how to
import MSXML3.dll and to get smart pointers.

Thanks for your help.

Markus

 

Re:Smart pointers with cppbuilder 4 (Import Type Library)


On 8 May 2002 08:30:31 -0700, widi.a...@t-online.de (Markus

Quote
Wiedenmaier) wrote:
>Hello together,

>I want to import the type library of msxml with Borland CPP-Builder 4.
>It works, but I get only raw interfaces not smart pointers, I want to
>work with.

>Does anybody know, how to get smart pointers with CPPB4? Does CPPB4
>supports smart pointers. I know in CPPB5 it works.

>I would be glad, if it is possible, if someone could explain how to
>import MSXML3.dll and to get smart pointers.

>Thanks for your help.

>Markus

can you use atl's CComPtr class?

CComPtr<IXMLDOMDocument> pDomDocument;
if(SUCCEEDED( pDomDocument.CoCreateInstance(CLSID_XMLDOMDocument) ))
{

        VARIANT_BOOL isSuccessful;

        pDomDocument->set_async(VARIANT_FALSE);
        pDomDocument->set_validateOnParse(vbValidateXml);
        pDomDocument->set_resolveExternals(vbResolveExternals);
        pDomDocument->loadXML((BSTR)bstrXML,
(TOLEBOOL*)&isSuccessful);

        if(isSuccessful == VARIANT_TRUE)
        {

and so on

Other Threads