While using VariantCopy method, I come across the following compile error:
error C2664: 'VariantCopy' : cannot convert parameter 2 from 'const VARIANT *' to 'VARIANTARG *'
Is there any way to solve this error? Do I need to include any preprocessor directive or library?
The signature of
VariantCopyused to beIt is strange, but the input parameter is not const, you should be aware of that in your code.
MSDN documentation explains why. The function might modify
pvargSrcUpdate
In the most recent SDK, the 2nd parameter became
const. However, I found this in MFC sources: