Invalid type cast in DLL repeat in version 5.70
Invalid type cast in DLL repeat in version 5.70
Hello!
I use your VCL component MyDac from DLL (С++). Both Application and dll use borlndmm.dll for memory managment and dynamic standart RTL lib. After update IDE from RAD Studio 2007 to version RAD Studio2009 appear problem:
some simple request to mysql like 'select name from mytable;' throw exception EInvalidCast on call TMyQuery::Execute.
Table description `mytable`:
is InnoDB engine;
contain fields `id` - integer (primary key) and `name` - char(32);
use cp1251 (Russian charset).
In revision history you write:
5.50.0.35 11-Jun-08
* Fixed bug with 'Invalid class typecast' error inside dlls.
May be problem not fixed in version 5.70?
Also problem appear in Trial version 5.80.
I use your VCL component MyDac from DLL (С++). Both Application and dll use borlndmm.dll for memory managment and dynamic standart RTL lib. After update IDE from RAD Studio 2007 to version RAD Studio2009 appear problem:
some simple request to mysql like 'select name from mytable;' throw exception EInvalidCast on call TMyQuery::Execute.
Table description `mytable`:
is InnoDB engine;
contain fields `id` - integer (primary key) and `name` - char(32);
use cp1251 (Russian charset).
In revision history you write:
5.50.0.35 11-Jun-08
* Fixed bug with 'Invalid class typecast' error inside dlls.
May be problem not fixed in version 5.70?
Also problem appear in Trial version 5.80.
This problem is connected with work with dll. The point is that you create the TMyConnection class object in an application and use it with the TMyQuery object, created in dll. These methods use the "as" operator which returns invalid type cast error.
To solve this problem you should create TMyConnection object in dll.
To solve this problem you should create TMyConnection object in dll.
Sorry to dig up an old thread, but I've just run into this problem myself.Dimon wrote:This problem is connected with work with dll. The point is that you create the TMyConnection class object in an application and use it with the TMyQuery object, created in dll. These methods use the "as" operator which returns invalid type cast error.
To solve this problem you should create TMyConnection object in dll.
The interesting thing is that it seems to have randomly cropped up. Until today this method (TMyConnection in App, Table/Query components in dll) has been working perfectly - in fact in all but one dll module it is still working.
Can you explain why it might have suddenly stopped working?