[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

converting COleVariant to CString

Posted on 2000-04-28
6
Medium Priority
?
710 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
ID: 2759029

COleVariant var;
CString str;

// ...

str = (LPCTSTR) var.bstrVal;
0
 

Author Comment

by:buccso
ID: 2759052
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
ID: 2759074
You should have rejected insted of grading a 'D'...
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

Expert Comment

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

Author Comment

by:buccso
ID: 2768417
I think you are a bit huffy. What does it matter, which greade do you get?
Nothing.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Loops Section Overview
Suggested Courses

825 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