Solved

converting COleVariant to CString

Posted on 2000-04-28
6
579 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Include multiple hostnames in this command? 3 53
Perl Awk Need Help 3 109
Expand data scrubbing tool 13 32
string initialization in java 11 110
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

911 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

23 Experts available now in Live!

Get 1:1 Help Now