Program ID and GUIDs
Question:
How do I find the GUID/ProgID for these? Tthe MSXML documentation doesn't include them and I've searched
my registry. (Funny it's got some MSXML 5.0 docs in the 4.0 SDK too).
; Dim cnth As IVBSAXContentHandler
cnth = objectopen("")
; 'If using SAX lexical handler, the following line is required.
; Dim lexh As IVBSAXLexicalHandler
lexh = objectopen("")
Versioning
MSXML 3.0 and later
Requirements
Implementation: msxml4.dll
[C/C++]
Header and LIB files: msxml2.h, msxml2.lib
Answer:
Maybe these will work.
oContentHandler = ObjectCreate("MSXML2.IVBSAXContentHandler")
oLexicalHandler = ObjectCreate("MSXML2.IVBSAXLexicalHandler")
Reference:
http://groups-beta.google.com/group/microsoft.public.scripting.vbscript/messages/00e7f9033062a280,dbc25de64a6ef16e,ff5435471cf81fd1,4ead6a614a17e8cd,0503ed6aa25661ef,60e03d370c6ac3ad,ea56a60aff56a9a9?thread_id=96c0a548b5a3c5b9&view=thread&noheader=1&q=IVBSAXContentHandler+createobject#doc_0503ed6aa25661ef
http://groups-beta.google.com/group/microsoft.public.xml.msxml-webrelease/messages/6cc79a793242786d,24439646e6578f33,d0bea5a9b1ebd00e?thread_id=d01a4c3cacab2a28&view=thread&noheader=1&q=IVBSAXContentHandler+createobject#doc_24439646e6578f33
User Reply:
Obviously your Google-Fu is much better than this grasshoppa...anyway like he says there's numerous VB examples throughout
the SDK but for that one they just left them off.
However, they didn't work. In fact in that second link you provided it seems to say you can't.
Subject: Re: SAX and ASP/JScript
Hi,
It won't work in a script client. If you take another look at the VB examples in MSDN you will see that oSaxReader.contentHandler
Well, let's see. I've got Visual Studio 6. I wonder if I can make a DLL and backdoor it somehow ...
Answer:
It could be done with an extender with one function. Basically the extender function would take the class string and use
it to create an instance of a COM object as a pointer to an IDispatch interface. You would then need to create a WB variable
that is a variant of type VT_DISPATCH and give it the IDispatch pointer. Once this is done you hand the variable back to WB
and it would take care of converting the variable into a WB COM object. You could then access the methods and properties
just like any other COM server. At least this is how it could work in theory...
On the practical side MSFT clearly does not want the SAX2 functionality to be available via late binding (a.k.a. scripting.) It appears that only reason they derived the COM interfaces from IDispatch was to allow VB (not VBS) easy access to the functionality.
WB's ObjectCreate function does not accept string class id's as parameters because late binding servers are supposed to register themselves such that a link is established between a progid and classid. Generally, ActiveX controls are the only exception to this. Perhaps we will add support for classid's to ObjectCreate in some future version of WB.
User Reply:
I did search the MSXML SDK but there were no entries for the LexicalHandler.
Answer:
It appears that the IVBSAXContentHandler interface is for an event handler. (I somehow managed to miss that despite the "handler"
in the name...) So to use it, you would need to somehow implement the object, as well as, hand it off to a WB IDispatch
variant variable.
IVBSAXContentHandler does not have a progid because it is implemented by the user with c++ or VB. Also might be able to
do with a wsc file but I am not sure about that.
Article ID: W17343
File Created: 2007:07:03:14:29:32
Last Updated: 2007:07:03:14:29:32