CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    16

    Convert COleVariant to CString

    How do I convert a COleVariant to CString?

    Thanks in advance


  2. #2
    Join Date
    May 1999
    Location
    Republic of Korea
    Posts
    100

    Re: Convert COleVariant to CString

    Try this!

    COleVariant var1;
    VARIANT var2;
    CString str;

    var2 = (LPVARIANT)var1;
    if (var2.vt == VT_UI1)
    str = var2->pbVal;
    else if (var2.vt == VT_BSTR)
    str = var2->bstrVal;

    Hope for help.
    And give other people a hand as well!

    Walter





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured