OLE Automation - Methods with parameters of type "const VARIANT" do not work with automation on i386.

Summary

Methods that have a parameter of type "const VARIANT" cause a crash if called through automation. Calling such methods via an interface works fine. If you remove the "const" modifier then the method works correctly (importtl tool adds "const" to property setter parameters by default). The problem applies to the i386 platform. On the x64 platform it works correctly.

System Information

  • Operating system: Windows
  • Processor architecture: x86
  • Compiler version: all
  • Device: Computer

Example Project

I attach sample server and client projects. test-autovariant.zip

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information