none
CComVariant ChangeType(VT_UI8), VariantChangeType VT_UI8 doesn't seem to work correctly RRS feed

  • Question

  • Hello,

    I have a native (C++) app running on WEC7, and code calling CComVariant ChangeType method (which calls VariantChangeType) with a type of VT_UI8 returns 0x80020008 (bad variable type). Is this a known bug? If so, is there a suggested work-around?

    Is there any documentation for which variant types are supported correctly?

    Thanks for any ideas,

    Jon

    Thursday, February 26, 2015 7:44 PM

Answers

  • Jon,

    No, you won't get any MS response here. If you have Windows Embedded Platform Builder, you get a couple of technical support "incidents" with that purchase. Using one of those, you can email MS, passing along your simple example. Start at support.microsoft.com. Choose Contact Us, Developer Support and choose Submit a technical support request for Microsoft products or services under Microsoft Technical Support. You'll probably have to give a credit card number while they figure out that you have Windows Embedded support.

    I think this is a limitation of the COM library on CE, but there's a small chance that MS will accept it as a bug.

    Paul T.

    • Marked as answer by JLibby Monday, March 16, 2015 10:45 PM
    Monday, March 9, 2015 5:31 PM

All replies

  • What type are you changing from? It might be worthwhile to create a simple example to show what you're doing (and potentially demonstrate to MS). I don't recall ever converting to a 'byte' before...

    Paul T.

    Wednesday, March 4, 2015 3:20 PM
  • Thanks much for reading and responding.

    This would be one example that doesn't work:

    CComVariant testVariant((int)1);
    HRESULT hr = testVariant.ChangeType(VT_UI8); //VT_I8 also fails

    As mentioned in original post, it fails with 0x80020008 (bad variable type). VT_I8 is documented as 8-byte integer (LONGLONG) and VT_UI8 is 8-byte unsigned integer (ULONGLONG)... these variant union fields (from SDK include file oaidl.h):

    struct tagVARIANT
        {
        union
            {
            struct __tagVARIANT
                {
                VARTYPE vt;
                union
                    {
                    LONGLONG llVal;
                    ...
                    ULONGLONG ullVal;
                    ...
            }    __VARIANT_NAME_1;
        };

    At least that's the way it works on Windows (starting with XP, I think W2K didn't have support for marshalling VT_I8,UI8).

    Regarding your mention of "demonstrate to MS": how does one best go about doing that? Is there a site/email to post issues? I was kinda thinking/hoping msdn forum might get some response from somebody at MS.

    Thanks again,

    Jon

    Thursday, March 5, 2015 7:17 PM
  • Jon,

    No, you won't get any MS response here. If you have Windows Embedded Platform Builder, you get a couple of technical support "incidents" with that purchase. Using one of those, you can email MS, passing along your simple example. Start at support.microsoft.com. Choose Contact Us, Developer Support and choose Submit a technical support request for Microsoft products or services under Microsoft Technical Support. You'll probably have to give a credit card number while they figure out that you have Windows Embedded support.

    I think this is a limitation of the COM library on CE, but there's a small chance that MS will accept it as a bug.

    Paul T.

    • Marked as answer by JLibby Monday, March 16, 2015 10:45 PM
    Monday, March 9, 2015 5:31 PM
  • Thanks for the response and answer. I appreciate. I'm guessing you're probably right that it's a CE COM library limitation.

    thanks again

    Jon

    Monday, March 16, 2015 10:48 PM