[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 724
  • Last Modified:

converting COleVariant to CString

How to convert a COleVariant to CString?
0
buccso
Asked:
buccso
  • 3
  • 3
1 Solution
 
jkrCommented:

COleVariant var;
CString str;

// ...

str = (LPCTSTR) var.bstrVal;
0
 
buccsoAuthor Commented:
It only converts the first char of the string. To work correctly you have to skip the cast.


0
 
jkrCommented:
You should have rejected insted of grading a 'D'...
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
buccsoAuthor Commented:
With a simple modification it solved the problem. I couldn't reject it.
0
 
jkrCommented:
'D' is 'hardly acceptable' - this is a bit insulting (at least for me)
0
 
buccsoAuthor Commented:
I think you are a bit huffy. What does it matter, which greade do you get?
Nothing.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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