type VARIANT and array - conversion to CString

R

romi

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.
 
C

CBFalconer

romi said:
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.
 
J

Joona I Palaste

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top