How do you create a client interface to receive events from a COM server? I'm thinking particularly of the MSXML2 library which includes the IVBSAXXMLReader interface which sends notifications to the IVBSAXErrorhandler object (this is the one I need to create). There's an "old school" solution in post #20 of this thread but I'm aiming at a version which avoids magic numbers, etc - that was the only option when Jose Roca wrrote the wrappers in 2004!
Is it necessary to declare the interface prototypes? This fans out into a lot of declarations when interfaces are passed as parameters. Is parameter type checking applied to uncalled methods/properties at run time? If not, can the interface parameters to these calls be redefined as dwords to avoid cascading ddeclarations? Can unreferenced methods/parameters be left out? Example:
Any donations gratefully received.
Is it necessary to declare the interface prototypes? This fans out into a lot of declarations when interfaces are passed as parameters. Is parameter type checking applied to uncalled methods/properties at run time? If not, can the interface parameters to these calls be redefined as dwords to avoid cascading ddeclarations? Can unreferenced methods/parameters be left out? Example:
Code:
' Interface Name : IVBSAXXMLReader ' Description : IVBSAXXMLReader interface ' Class Name : SAXXMLReader40 ' ClassID : $CLSID_MSXML2_SAXXMLReader40 ' ProgID : $PROGID_MSXML2_SAXXMLReader30 ' Version ProgID : $PROGID_MSXML2_SAXXMLReader400 Interface IVBSAXXMLReader $IID_MSXML2_IVBSAXXMLReader Inherit IDispatch Method getFeature <1282> (Byval strName As WString) As Integer Method putFeature <1283> (Byval strName As WString, Byval fValue As Integer) Method getProperty <1284> (Byval strName As WString) As Variant Method putProperty <1285> (Byval strName As WString, Byval varValue As Variant) Property Get entityResolver <1286> () As IVBSAXEntityResolver Property Set PutRef_entityResolver <1286> (ByVal oResolver As IVBSAXEntityResolver) Property Get contentHandler <1287> () As IVBSAXContentHandler Property Set PutRef_contentHandler <1287> (ByVal oHandler As IVBSAXContentHandler) Property Get dtdHandler <1288> () As IVBSAXDTDHandler Property Set PutRef_dtdHandler <1288> (ByVal oHandler As IVBSAXDTDHandler) Property Get errorHandler <1289> () As IVBSAXErrorHandler Property Set PutRef_errorHandler <1289> (ByVal oHandler As IVBSAXErrorHandler) Property Get baseURL <1290> () As WString Property Set baseURL <1290> (ByVal strBaseURL As WString) Property Get secureBaseURL <1291> () As WString Property Set secureBaseURL <1291> (ByVal strSecureBaseURL As WString) Method parse <1292> (Byval varInput As Variant) Method parseURL <1293> (Byval strURL As WString) End Interface
Comment