XML DOM in ATL
-
While i using an interface of DOM (IXMLDOMNode *) as an parameter of an interface like that :
[helpstring("method Load")] HRESULT Load([in]IXMLDOMNode * piXMLNode);
there is an midl error : midl\oleaut32.dll : error MIDL2020 : error generating type library : AddImplType failed : IXMLDOMDocument How it caused and how to handle it? thank. Scratch -
While i using an interface of DOM (IXMLDOMNode *) as an parameter of an interface like that :
[helpstring("method Load")] HRESULT Load([in]IXMLDOMNode * piXMLNode);
there is an midl error : midl\oleaut32.dll : error MIDL2020 : error generating type library : AddImplType failed : IXMLDOMDocument How it caused and how to handle it? thank. ScratchYou can only pass a limited number of parameters on a COM interface, and the only way to pass COM objects is as an IUnkown * ( and maybe IDispatch *, I forget ). Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
-
You can only pass a limited number of parameters on a COM interface, and the only way to pass COM objects is as an IUnkown * ( and maybe IDispatch *, I forget ). Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
-
While i using an interface of DOM (IXMLDOMNode *) as an parameter of an interface like that :
[helpstring("method Load")] HRESULT Load([in]IXMLDOMNode * piXMLNode);
there is an midl error : midl\oleaut32.dll : error MIDL2020 : error generating type library : AddImplType failed : IXMLDOMDocument How it caused and how to handle it? thank. ScratchIf you are defining a custom interface or dual interfaces, gorget what Christian said to you: you CAN do it. The only problem will appear when you use a [in, out] parameter, and then, the only problem will be that scripting clients won't be able to call your method (you'll get a "type mismatch" from VBScript) You need to put a
importlib
in your IDL file, under the library section: For importing ADO, you could do this: importlib("c:\program files\common files\system\ado\msado26.tlb"); change the path to the MSXML parser type library on your development machine; PS: As much as I hate VB, it can be a great tool for protoryping COM interfaces and quickly writing a IDL. When you don't know how to define a COM interface, create a COM DLL in VB with the desired interface and look the IDL on OLEVIEW I see dumb people -
If you are defining a custom interface or dual interfaces, gorget what Christian said to you: you CAN do it. The only problem will appear when you use a [in, out] parameter, and then, the only problem will be that scripting clients won't be able to call your method (you'll get a "type mismatch" from VBScript) You need to put a
importlib
in your IDL file, under the library section: For importing ADO, you could do this: importlib("c:\program files\common files\system\ado\msado26.tlb"); change the path to the MSXML parser type library on your development machine; PS: As much as I hate VB, it can be a great tool for protoryping COM interfaces and quickly writing a IDL. When you don't know how to define a COM interface, create a COM DLL in VB with the desired interface and look the IDL on OLEVIEW I see dumb peopleAnother question ... When the midl process my .idl file ,it arbitrarily import the default msxml sdk and use the old version objects. if use one of these directors #include "C:\Program Files\MSXML 4.0\inc\msxml2.h" #include "C:\Program Files\MSXML 4.0\inc\msxml2.idl" #import "C:\winnt\system32\msxml4.dll" no_namespace Certain Interfaces are redefine . My wonder how to got rid of the midl's default msxml library and use my own sdk library? Scratch
-
You can only pass a limited number of parameters on a COM interface, and the only way to pass COM objects is as an IUnkown * ( and maybe IDispatch *, I forget ). Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
Christian Graus wrote: You can only pass a limited number of parameters on a COM interface, and the only way to pass COM objects is as an IUnkown * ( and maybe IDispatch *, I forget ). Actually, you can pass anything as long as the midl-compiler knows about it. I.e. anything declared within the same idl file or imported from another idl-file. -- This space for rent.