subclassing IXMLDOMDocument

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

subclassing IXMLDOMDocument

Günther Schmidt
Hi,

I've created a subclass of IXMLDOMDocument, just adding a few methods.

When I send new to that subclass I get an error.

        "Interface not supported"

How come?

Günther


Reply | Threaded
Open this post in threaded view
|

Re: subclassing IXMLDOMDocument

James Foster-3
I've always used XML through composition rather than through inheritance
(see
http://www.object-arts.com/EducationCentre/Patterns/InheritanceVsComposition.htm 
for a discussion of these ideas). In looking at the class hierarchy for
IXMLDOMDocument, I note that there are some class instance variables
(template, flags, alignment, argSizes, functions, and typeLib). This alone
means that simply subclassing is not enough--more would need to be done (and
I undertand that you are asking what more needs to be done and I can't
answer that ;-).

If your goal is to solve a problem using XML, then I'd ask why you chose
inheritance rather than composition. If your goal is to understand the
IXMLDOMNode hierarchy, then I'm sorry I'm not much help.

James Foster

"Günther Schmidt" <[hidden email]> wrote in message
news:42bb85d1$[hidden email]...

> Hi,
>
> I've created a subclass of IXMLDOMDocument, just adding a few methods.
>
> When I send new to that subclass I get an error.
>
> "Interface not supported"
>
> How come?
>
> Günther