|
#1
|
|||
|
|||
|
I'm going from VS 6.0 to VS .NET 2003. I'm converting a project and can't
get it to compile. I've created a small Win32 console app that reproduces the compiler error. This has got to be something dumb. Please help. #import <msxml.dll> int _tmain(int argc, _TCHAR* argv[]) { IXMLDOMDocumentPtr Xml; Xml->createElement(_T("Tagname")); return 0; } The compiler error is: error C2660: 'IXMLDOMDocument::createElement' : function does not take 1 arguments When I go to the definition of createElement, it shows three types: inline IXMLDOMElementPtr IXMLDOMDocument::createElement ( _bstr_t tagName ) inline IXMLElementPtr IXMLDocument::createElement ( const _variant_t & vType, const _variant_t & var1 ) inline IXMLElement2Ptr IXMLDocument2::createElement ( const _variant_t & vType, const _variant_t & var1 ) IntelliSense shows the first one only, which is what I want to use. What am I missing on the #import or is there something else I'm supposed to do? If I have to use the second declaration of createElement, I don't know what vType and var1 should be set to. |
|
#2
|
|||
|
|||
|
Okay, I think I figured it out. I had to add MSXML namespace scope to my
declaration. i.e. MSXML::IXMLDOMDocumentPtr Xml; .... It seems that if I don't do that, then methods there are collisions and the compiler chooses, I suspect, the entries in msxml.h instead of the msxml.tlh and msxml.tli files. "Leo" <lviolette_at_orrtax_com> wrote in message news:ugOFeG82DHA.3256@tk2msftngp13.phx.gbl... > I'm going from VS 6.0 to VS .NET 2003. I'm converting a project and can't > get it to compile. I've created a small Win32 console app that reproduces > the compiler error. This has got to be something dumb. Please help. > > #import <msxml.dll> > > int _tmain(int argc, _TCHAR* argv[]) > { > IXMLDOMDocumentPtr Xml; > Xml->createElement(_T("Tagname")); > return 0; > } > > The compiler error is: > error C2660: 'IXMLDOMDocument::createElement' : function does not take 1 > arguments > > When I go to the definition of createElement, it shows three types: > inline IXMLDOMElementPtr IXMLDOMDocument::createElement ( _bstr_t tagName ) > inline IXMLElementPtr IXMLDocument::createElement ( const _variant_t & > vType, const _variant_t & var1 ) > inline IXMLElement2Ptr IXMLDocument2::createElement ( const _variant_t & > vType, const _variant_t & var1 ) > > IntelliSense shows the first one only, which is what I want to use. What am > I missing on the #import or is there something else I'm supposed to do? If > I have to use the second declaration of createElement, I don't know what > vType and var1 should be set to. > > |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|