Solved

converting COleVariant to CString

Posted on 2000-04-28
6
565 Views
Last Modified: 2013-11-20
How to convert a COleVariant to CString?
0
Comment
Question by:buccso
  • 3
  • 3
6 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
Comment Utility

COleVariant var;
CString str;

// ...

str = (LPCTSTR) var.bstrVal;
0
 

Author Comment

by:buccso
Comment Utility
It only converts the first char of the string. To work correctly you have to skip the cast.


0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
You should have rejected insted of grading a 'D'...
0
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

 

Author Comment

by:buccso
Comment Utility
With a simple modification it solved the problem. I couldn't reject it.
0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
'D' is 'hardly acceptable' - this is a bit insulting (at least for me)
0
 

Author Comment

by:buccso
Comment Utility
I think you are a bit huffy. What does it matter, which greade do you get?
Nothing.
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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

771 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

10 Experts available now in Live!

Get 1:1 Help Now