Go Back   Talk Root - PC Hardware, Software and Web Development forums > Internet & Website Management > Programming Discussion > XML



Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
  #1  
Old 01-15-2004, 03:48 PM
Leo
Guest
 
Posts: n/a
Default C++ VS.NET 2003 simple XML sample problem.

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.


Reply With Quote
  #2  
Old 01-15-2004, 04:36 PM
Leo
Guest
 
Posts: n/a
Default Re: C++ VS.NET 2003 simple XML sample problem.

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.
>
>



Reply With Quote
Reply

Bookmarks
Sponsored Links
FatCow $88 Plan for $66 only Host Unlimited Domains on 1 Account Professional Hosting from Just Host


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On



All times are GMT -7. The time now is 10:54 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
© 2008 TalkRoot.com