Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Passing const _variant_t & to a function in a dll

Posted on 2001-06-15
3
Medium Priority
?
455 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 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

916 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