CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Codeplug

Search: Search took 0.06 seconds.

  1. Replies
    13
    Views
    14,090

    Re: How to determine if VARIANT contains an Array?

    >> Something like storing them in a Generic Variable then converting that generic variable to a string?
    The closest thing to it would be to store each of the SAFEARRAY members into a VARIANT (which...
  2. Replies
    13
    Views
    14,090

    Re: How to determine if VARIANT contains an Array?

    For a SAFEARRAY variant, the SAFEARRAY API's are what you have to work with. So you'll have to use those API's to process it into what ever representation yourself.

    gg
  3. Replies
    13
    Views
    14,090

    Re: How to determine if VARIANT contains an Array?

    >> Does this mean that it is possible ...
    Anything is possible when you don't use structures/API's correctly. Only access "bstrVal" if "vt" is VT_BSTR.

    The call to SafeArrayGetElement() looks...
  4. Replies
    13
    Views
    14,090

    Re: How to determine if VARIANT contains an Array?

    >> I need to convert the VARIANT to SAFEARRAY?
    V_ARRAY() is a macro that accesses the "parray" member of the VARIANT - just like V_VT() accesses the "vt" member.

    If the vt member is "VT_I4 |...
  5. Replies
    13
    Views
    14,090

    Re: How to determine if VARIANT contains an Array?

    >> Additional question, is this the correct way to get the contents of the array?
    No. You access the SAFEARRAY member of the variant using V_ARRAY(). Then use SAFEARRAY api's -...
  6. Replies
    13
    Views
    14,090

    Re: How to determine if VARIANT contains an Array?

    VARTYPE is a bit-field. So an array of BSTR's would be "VT_ARRAY | VT_BSTR" etc...
    http://msdn.microsoft.com/en-us/library/ms221627.aspx

    gg
Results 1 to 6 of 6





Click Here to Expand Forum to Full Width

Featured