Solved

Passing const _variant_t & to a function in a dll

Posted on 2001-06-15
3
391 Views
Last Modified: 2013-11-20
I have used the #import to import the msxml.dll in one of my projects.  The following function is giving me trouble.
IXMLDOMNodePtr createNode ( const _variant_t & type, _bstr_t name, _bstr_t namespaceURI );

How do you pass the first argument in.  I tryed to pass the nodeType property from another node into it and I get compile errors. I have tryed to cast the argument to a COleVariant object, and that also gives an error.
0
Comment
Question by:c095276
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
ShaunWilde earned 50 total points
ID: 6196544
what have you tried - I would do it like this

_variant_t varType(NODE_ELEMENT); // 1

myObj->createNode(varType,...);
0
 

Author Comment

by:c095276
ID: 6196691
Thanks I actually had to cast the NODE_ELEMENT to a BYTE, but it seem to work great.
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 6196724
you could also do

myObj->createNode("element",...); // NODE_ELEMENT
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
move a line in eclipse 3 60
twoTwo  challenge 35 86
EvenOdd challenge 10 83
How to convert MFC::CString to UTF8 wchar_t* 10 97
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now