Главная страница | назад





Article #15941: OLE Exception: 'Type mismatch'

 Question and Answer Database

FAQ941C.txt   OLE Exception: 'Type mismatch'
Category   :VCL
Platform    :All
Product    :C++Builder  1.x

Question:
When passing Variant arguments to Variant::OleProcedure, I get
an OLE exception "Type mismatch".  Why?

Answer:
VCL's implementation of Variant::OleProcedure is broken.  
Instead of calling OleProcedure, try doing the following,

Variant vOLEServer = CreateOleObject(...);
variantarg v;

// Initialize v, your arguments to the OLE server's procedure
.
.
.

Procedure p("SomeServerProc");
p << &variantarg;  //VCL only supports passing Variants by ref
vOleServer.Exec(p);






7/2/98 10:32:32 AM
 

Last Modified: 01-SEP-99