Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > type VARIANT and array - conversion to CString

Reply
Thread Tools

type VARIANT and array - conversion to CString

 
 
romi
Guest
Posts: n/a
 
      09-02-2004
Hi
I have a problem, I want to convert program in Visual Basic 6 to VC++6.
Program in VB works OK., but in VC++ I don't know how to convert 'VARIANT'
to 'Cstring'.
How to convert 'VARIANT ww' to 'CString pp'

In C++ debug info I have:
ww={???}
ww.vt=8204
pvarVal={VT_NULL}
hr=0


Visual C++
-------------------------------------------------------------
BSTR _name;
_name = SysAllocString(L"Name");
VARIANT ww;
//sdoc->GetItemValue(BSTR pName, VARIANT *pValues)
HRESULT hr = sdoc->GetItemValue(_name, &ww);
CString pp;
pp = ww; // HOW TO MAKE IT WORK ???
-------------------------------------------------------------


Visual Basic:
-------------------------------------------------------------
Dim ww As String
ww = sdoc.GetItemValue("Name")(0)
-------------------------------------------------------------


GREAT THANKS FOR ANY HELP

r.




 
Reply With Quote
 
 
 
 
CBFalconer
Guest
Posts: n/a
 
      09-02-2004
romi wrote:
>
> I have a problem, I want to convert program in Visual Basic 6 to
> VC++6. Program in VB works OK., but in VC++ I don't know how to
> convert 'VARIANT' to 'Cstring'.
> How to convert 'VARIANT ww' to 'CString pp'


Read the name of the newsgroup carefully. Note the lack of '++'
in the name. Also bear in mind that VB and VC are exclusively
Microsoft entities, and inherently non-portable. This might guide
you to searching for groups with 'Microsfot' in their names.

I.E. this is off-topic here.

--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


 
Reply With Quote
 
 
 
 
Joona I Palaste
Guest
Posts: n/a
 
      09-02-2004
CBFalconer <(E-Mail Removed)> scribbled the following:
> romi wrote:
>> I have a problem, I want to convert program in Visual Basic 6 to
>> VC++6. Program in VB works OK., but in VC++ I don't know how to
>> convert 'VARIANT' to 'Cstring'.
>> How to convert 'VARIANT ww' to 'CString pp'


> Read the name of the newsgroup carefully. Note the lack of '++'
> in the name. Also bear in mind that VB and VC are exclusively
> Microsoft entities, and inherently non-portable. This might guide
> you to searching for groups with 'Microsfot' in their names.


You won't find many groups with "Microsfot" in their names. I know, I
know, I should STFW^HU...

--
/-- Joona Palaste ((E-Mail Removed)) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"'I' is the most beautiful word in the world."
- John Nordberg
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert CString to Variant Gertjan Huiskes C++ 1 01-04-2007 10:06 PM
convert VARIANT to CSTRING michael mazanek C++ 1 09-18-2006 05:52 PM
conversion array of double in variant Luc Dal ASP General 4 09-09-2005 04:22 PM
type VARIANT and array - conversion to CString romi C++ 1 09-02-2004 10:52 AM
CString to const char conversion Fausto Lopez C++ 9 07-13-2004 03:38 PM



Advertisments