I have written an IDispatch wrapper class in VC++ 6.0 that works
pretty well in most cases. The problem started when I tried to use it
to drive the MSXML parser (ver 3 or above is what I will be using).
The transformNode method takes a pointer to IXMLDOMNode as an input
parameter ... how can I get a pointer to that interface if I have an
IDispatch interface of an Msxml2.DOMDocument.3.0? I tried passing the
IDispatch pointer to transformNode and it didn't like it. |
Request for Question Clarification by
mathtalk-ga
on
31 Jan 2003 09:21 PST
Hi, snorkel-ga:
Just to clarify things a bit:
1) Are you writing code in VC++ 6.0 which tries to call the
transformNode method of a DOM document?
2) Did you try passing the (IDispatch) interface of the DOM document
as the argument to transformNode which requires an IXMLDOMNode
"object"? (A DOM document is not a DOM document node; they have
different methods.)
regards, mathtalk-ga
|
Clarification of Question by
snorkel-ga
on
03 Feb 2003 08:14 PST
1) Yes, I'm using VC++ 6.0 and trying to call the transformNode
Method of the DOMDocument
2) I tried passing the DOMDocument IDispatch ... did not work. I
also tried passing the interface returned by selectSingleNode to the
transformNode ... did not work.
The MSDN documentation for transforNode says that the first parameter
has a type of IXMLDOMNode but the description of this parameter says
"Valid XML document or DOM node that consists of XSLT elements that
direct the transformation of this node".
I wrote a small test program in VB to do this transform and it works
fine either way (passing the DOMDocument object or the return from
selectSingleNode). My VB test app uses variables of type Object and
sets them equal to CreateObject("Msxml2.DOMDocument.3.0").
|
Clarification of Question by
snorkel-ga
on
03 Feb 2003 08:18 PST
P.S. I doubled the List Price ... I really need a solution! :)
|
Request for Question Clarification by
mathtalk-ga
on
04 Feb 2003 19:05 PST
Hi, snorkel-ga:
I have worked with the MS XML 3.0 parser and above, and I can
certainly show you sample code in VC++ 6.0 that will call tranformNode
on one XML document passing in as first argument the pointer to
another DOM containing the XSLT "stylesheet" and as second argument
the "string" (BSTR) that will hold the output XML.
What I think deserves clarification is your desire to use the
IDispatch wrapper class that you wrote. I cannot at present
understand how this is being used. Perhaps if you post a code snippet
where you try to call transformNode and the resulting error message,
the difficulty will become clear to me.
Or if you simply want sample code that works in VC++ 6.0 without your
wrapper, let me know and I will post that.
regards, mathtalk-ga
|
Request for Question Clarification by
mathtalk-ga
on
09 Feb 2003 09:57 PST
Hi, snorkel-ga:
If you are still interested, please post a code snippet showing the
code you have that does not work or, in the alternative, indicate that
you'd be willing to accept a commented sample of VC++ code that does
work as an answer.
Normally VC++ doesn't need the dispatch interface as the correct
interfaces are known at compile time; scripting environments need the
dispatch interface because all binding is being done on the fly.
I hesitate to post an answer without understanding more clearly if you
seek a better understanding about how to use the dispatch interface in
VC++ or you simply want to make direct use of MSXML parser to perform
an XSLT transform.
regards, mathtalk-ga
|
Clarification of Question by
snorkel-ga
on
10 Feb 2003 07:01 PST
I need to bind on the fly in this case. VC++ only knows about the
interfaces at compile time if you use early binding. My code is
probably too long to post. If you have an example of calling
transformNode in a late binding situation, that would be great.
|