Hello,
I have the same problem of my collegue Laurent.
Here are more information about the environnement of the error message :
I'm using a Delphi DLL which return an object "TDLLObj" containing TOracleQuery and TOracleDataSet components.
In the Delphi program using this DLL, I call a Create function which return an instance of "TDLLObj".
"TDLLObj" has an initialization procedure which need in parameter a TOracleSession (which is in the Delphi program).
This initialization function assign this TOracleSession to the session of TOracleQuery and TOracleDataSet components in "TDLLObj".
When I reconnect the TOracleSession in Delphi program, I have this error in french :
"Transtypage de classe incorrect" => "Invalid class cast"
The call stack shows the exception in : TOracleQuery.SetDefaultVariableCharSets -> TVariables.Data
The problem semms to be that, when the TOracleSession is disconnected and then connected, a DOA procedure assigns all TOracleQuery and TOracleDataSet linked to this session. But in this case, this reassignment can not work properly when TOracleQuery and TOracleDataSet are in a DLL.
------------------------------------
Init function in DLL :
function TDLLObj.Init(oraSession: TOracleSession);
begin
oraQuery.Session := oraSession;
oraDataSet.Session := oraSession;
end;
------------------------------------
Delphi program :
// Oracle connexion
mySession.Connected := false;
mySession.Connected := true;
// Loading DLL and creating DLLObj object
...
myDLL := CreateDLLObj();
...
myDLL.Init(mySession);
...
//Invoke some function in the DLL
myDLL.Function1();
// Reconnect Oracle Session
mySession.Connected := false;
mySession.Connected := true; => error message
DOA version : 4.1.1.0
Delphi 2009 (CodeGear