type VARIANT and array - conversion to CString

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • romi

    #1

    type VARIANT and array - conversion to CString

    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_NUL L}
    hr=0


    Visual C++
    -------------------------------------------------------------
    BSTR _name;
    _name = SysAllocString( L"Name");
    VARIANT ww;
    //sdoc->GetItemValue(B STR 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.GetItemVal ue("Name")(0)
    -------------------------------------------------------------


    GREAT THANKS FOR ANY HELP

    r.




  • CBFalconer

    #2
    Re: type VARIANT and array - conversion to CString

    romi wrote:[color=blue]
    >
    > 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'[/color]

    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?


    Comment

    • Joona I Palaste

      #3
      Re: type VARIANT and array - conversion to CString

      CBFalconer <cbfalconer@yah oo.com> scribbled the following:[color=blue]
      > romi wrote:[color=green]
      >> 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'[/color][/color]
      [color=blue]
      > 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.[/color]

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

      --
      /-- Joona Palaste (palaste@cc.hel sinki.fi) ------------- Finland --------\
      \-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
      "'I' is the most beautiful word in the world."
      - John Nordberg

      Comment

      Working...