• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 397
  • Last Modified:

COleVariant

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
xlr8tn
Asked:
xlr8tn
1 Solution
 
prasanthCommented:
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now