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





Article #15031: Why does my TAutoObject method crash ?

 Question and Answer Database
FAQ31C.txt Why does my TAutoObject method crash ?
Category :VCL
Platform :All
Product :C++Builder 1.x
Question:
I have a TAutoObject-derived class which has a method which
has a Variant parameter passed by value. This method crashes
upon return.
Answer:
AutoObject::InvokeMethod does not have support for passing
Variant parameters by value.
Don't create TAutoObject methods which take Variant by value
parameters.
TAutoObject methods can only have parameters of intrinsic types
(int, float, String, void), Variant references (Variant& or
Variant*) but not Variants by value (Variant v)
//eg. Do this,
class TMyAutoObject : public TAutoObject{
__automated:
void __fastcall foo(Variant* v);
}
//eg. Don't do this,
class TMyAutoObject : public TAutoObject{
__automated:
void __fastcall foo(Variant v);
}
7/2/98 10:32:32 AM

Last Modified: 01-SEP-99