🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.upgrade
Article #2532

Bug in C++ Builder service pack 1

#2532
From: Yakov Becker
Date: Thu, 25 Nov 1999 00:00
50 lines
2244 bytes
I use Microsoft XML (Version 2) COM object.
It worked fine in C++ Builder before I installed service pack 1.
Now it raises exception in:
DOMElementObj->get_tagName() function (it happens in many other functions
too)
I also noticed that utilcls.h in source and include directories
are different after service pack 1 installation.
Service pack 2 doesn't help.

Here is my code:

DOMDocument *DOMDocumentObj = NULL;
HRESULT hr;

   // Create an empty XML document
   hr = CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,
                         IID_IXMLDOMDocument, (void**)&DOMDocumentObj);

   if( FAILED(hr ) )
        return;

   DOMDocumentObj->validateOnParse = true;

   WideString XMLString("<?xml version=\"1.0\"?> <root> <node1> <child1
name=\"yasha\"/> <child2 name=\"guy\"/> </node1> <node2>  <child1/>
<child2/> </node2> </root>");
   DOMDocumentObj->loadXML( XMLString.c_bstr() );
   MemoOutput->Clear();

   IXMLDOMElement *DOMElementObj = DOMDocumentObj->get_documentElement();
   MemoOutput->Lines->Add(DOMElementObj->get_tagName()); <-- it fails here

I also tried to use DOMDocumentObj = CoDOMDocument::Create(); instead of
CoCreateInstance
but it doesn't work at all: I have the exception on
DOMDocumentObj->validateOnParse = true;
It seems that problem is in import type library operation because C++
Builder with service pack 1
works fine (compile and run) on files that have been created with C++
Builder without
service pack.
I have two questions:
1. Why DOMDocumentObj = CoDOMDocument::Create(); doesn't work?
2. What is the problem with C++ Builder with service pack 1 import type
library method?


Thanks in advance.

Yakov Becker
Technical Details
Message-ID: <81jke9$8rn2@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10529a,40ae11906a7be57d,start
X-Google-Attributes: gid10529a,public
From: "Yakov Becker" <yasha@i-tr.com>
Subject: Bug in C++ Builder service pack 1
Date: 1999/11/25
Message-ID: <81jke9$8rn2@forums.borland.com>
X-Deja-AN: 552956410
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Organization: Intelligent Trading
X-MSMail-Priority: Normal
Reply-To: "Yakov Becker" <yasha@i-tr.com>
Newsgroups: borland.public.cppbuilder.upgrade