Solved

COleVariant

Posted on 1998-08-30
1
381 Views
Last Modified: 2008-03-06
Need some help in converting COleVariant into actual strings that I can use.  Here is an exerpt of code that retreives a project number from an Access DB:  

COleVariant vProject = ProjectSet.GetFieldValue("ProjectNumber");

Now, what I need is to compare vProject to a CString data type so how do I convert it?

Is there any place I could find help on this as what is in VC++ isn't really geared towards conversion of data types.

-Brent
0
Comment
Question by:xlr8tn
1 Comment
 
LVL 2

Accepted Solution

by:
prasanth earned 50 total points
ID: 1171621
CString str =  V_BSTR(&vProject);

I agree the documentation isn't too great in this area. But all the extraction macros for the various data types are defined in OLEAUTO.H
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

747 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

13 Experts available now in Live!

Get 1:1 Help Now