Solved

Passing const _variant_t & to a function in a dll

Posted on 2001-06-15
3
425 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Show shut-down message as Windows 8 shuts down. 9 99
Shell script to login to remote m/c and execute commands 10 78
has22 challenge 11 104
fizzArray2 challenge 1 90
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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…
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

839 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