cannot convert from '_variant_t' to '__int64' Ambiguous user-defined-conversion

anyone know the cause of this error I've looked at the manual _variant_t's extrators have a conversion to __int64 so why is the compiler giving me an error

Answer this question

cannot convert from '_variant_t' to '__int64' Ambiguous user-defined-conversion

  • bala_7272

    so I looked at the header file and the __int64 conversoin operator is ifdefed to nt 501.. why is that This isn't an os specific code it's just converting. And why isn't this in the documentation
  • jhallen

    Earlier versions of Windows did not support the VT_I8 and VT_UI8 variant types so this is why they are under #ifdef.

  • database_mentor

    Define WINVER and _WIN32_WINNT to be 0x501 then before you include the headers. I'm not sure why __int64 is not allowed on lower versions of windows, but if thats the case then you can compile it for the higher version, unless you want to run it on windows 2000 or lower.


  • EHoward

    I do want to run it on NT5, those are the product specs and that includes windows 2000. I'm baffled why it's ifdefed to 501, VI_8 works, changetype to VI_8 also works. I changed the ifdef to 500, I'll test it on windows 2000 to see if there are any problems with it.
  • cannot convert from '_variant_t' to '__int64' Ambiguous user-defined-conversion