473,324 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

How to convert Cstring to variant /variant to cstring

39
Hi all ,
How can i convert a Cstring to VARIANT and vice versa ...

Thanks in advance
Mar 22 '10 #1
1 4272
weaknessforcats
9,208 Expert Mod 8TB
First, create a VARIANT variable.
Second, convert your CString into a type that is one of the VariantType enumerated types. and assign the result to your VARIANT.
Third, set the vt member of your VARIANT.

There are code examples in MSDN on how to create VARIANTS.
Mar 22 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Markus Hämmerli | last post by:
I ' ll tra to convert a Cstring to char* without success. I working in a Unicode enabled environment this is working in Unicode CString source = _T("TestString"); TCHAR *szSource =...
2
by: jt | last post by:
Looking for an example how to convert and CString to an ASCII character string. Any examples on how to do this? Thank you, jt
3
by: Morten Overgaard | last post by:
Hi How do I convert a managed System::String to a CString. I need to handle unicode characters ( Japan and Chinese ) as well as "normal" ANSI characters. I have tried the following char* p...
2
by: Hai Ly Hoang [MT00KSTN] | last post by:
CString.FormatMessage and CString.Format has the same parameters and they seems to have to outcome. However, they coexist !. There must be some subtle different between they. Can you tell me the...
15
by: Yifan | last post by:
Hi Does anybody know how to convert System::String* to char*? I searched the System::String class members and did not find any. Thanks Yifan
28
by: MLH | last post by:
The largest integer A97 can deal with is 2,147,483,647, as I understand it from HELP. I would be content to represent larger integers as strings. For example, "2147483648" would suit me fine. I...
6
by: Xiaoshen Li | last post by:
Dear All, I saw some people using #include <string.h> some people using #include <cstring> What is the difference between the two? I can find the file string.h at /usr/include. I don't...
1
by: michael mazanek | last post by:
Hi all, i have a VARIANT variable which contains a "friendly name" of a video-codec (direct show). Does anyone know how to retrieve the friendly name as a string to display it on the console? ...
1
by: Gertjan Huiskes | last post by:
Hello all, I want to convert a CString to a Variant. I'm using COleVariant to do this, and it works ok... but by using COleVariant, the whole string is placed on the stack twice!!!!! ...
4
by: krishp | last post by:
Hi, I need to convert raw data recieved from a device through C#.Net socket to BMP format. For some reason the image conversion is not happening proparly and I can see only blur image . ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.