Solved

converting COleVariant to CString

Posted on 2000-04-28
6
635 Views
Last Modified: 2013-11-20
How to convert a COleVariant to CString?
0
Comment
Question by:buccso
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iSeries DB2 Query 2 101
abstract class with all non abstract mentods 6 87
Modbus - whats the maximum I can store in one register? 4 84
Capture logon name 13 117
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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