Solved

Passing const _variant_t & to a function in a dll

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to know only "File created" with EventLog 3 34
while loop over for loop 7 104
sumHeights  challenge 17 71
x-bar in Google Sheets 2 55
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

809 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