type VARIANT and array - conversion to CString

Discussion in 'C++' started by romi, Sep 2, 2004.

  1. romi

    romi Guest

    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.
     
    romi, Sep 2, 2004
    #1
    1. Advertising

  2. * romi:
    > ...


    offtopic

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
     
    Alf P. Steinbach, Sep 2, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fausto Lopez

    CString to const char conversion

    Fausto Lopez, Jul 12, 2004, in forum: C++
    Replies:
    9
    Views:
    12,563
    Richard Herring
    Jul 13, 2004
  2. romi
    Replies:
    2
    Views:
    638
    Joona I Palaste
    Sep 2, 2004
  3. michael mazanek

    convert VARIANT to CSTRING

    michael mazanek, Sep 18, 2006, in forum: C++
    Replies:
    1
    Views:
    709
    Howard
    Sep 18, 2006
  4. Gertjan Huiskes

    Convert CString to Variant

    Gertjan Huiskes, Jan 4, 2007, in forum: C++
    Replies:
    1
    Views:
    625
    Victor Bazarov
    Jan 4, 2007
  5. Luc Dal

    conversion array of double in variant

    Luc Dal, Sep 9, 2005, in forum: ASP General
    Replies:
    4
    Views:
    451
    Evertjan.
    Sep 9, 2005
Loading...

Share This Page