|
Incorrect Class Transtype at the LogOn
|
Joined: Mar 2009
Posts: 1
Member
|
OP
Member
Joined: Mar 2009
Posts: 1 |
Hi,
In a treatment in a program developed with Delphi 2009, I have the following error (in French) :
Exception d
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Aug 1999
Posts: 22,221
Member
|
Member
Joined: Aug 1999
Posts: 22,221 |
I have no idea. Can you obtain the exact English message text?
Marco Kalter Allround Automations
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Sep 2004
Posts: 29 Bordeaux (France)
Member
|
Member
Joined: Sep 2004
Posts: 29 Bordeaux (France) |
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
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Sep 2004
Posts: 29 Bordeaux (France)
Member
|
Member
Joined: Sep 2004
Posts: 29 Bordeaux (France) |
No idea for a solution of my problem ?
-- Hugues
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Aug 1999
Posts: 22,221
Member
|
Member
Joined: Aug 1999
Posts: 22,221 |
Not really. What happens if you use ShareMem instead of SimpleShareMem?
Marco Kalter Allround Automations
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Sep 2004
Posts: 29 Bordeaux (France)
Member
|
Member
Joined: Sep 2004
Posts: 29 Bordeaux (France) |
I've have try to use ShareMem instead of SimpleShareMem, same result and error message.
It means that TOracleSession cannot be pass throught a DLL ?
Another idea to resolve this bug ?
Thanks in advance -- Hugues
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Aug 1999
Posts: 22,221
Member
|
Member
Joined: Aug 1999
Posts: 22,221 |
We'll check it out by trying the dlldemo project in Delphi 2009.
Marco Kalter Allround Automations
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Sep 2004
Posts: 29 Bordeaux (France)
Member
|
Member
Joined: Sep 2004
Posts: 29 Bordeaux (France) |
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Sep 2004
Posts: 29 Bordeaux (France)
Member
|
Member
Joined: Sep 2004
Posts: 29 Bordeaux (France) |
I would like to know if you have found a solution about this specific problem because it becomes urgent to found a solution in order to continue my development.
Thanks
-- Hugues
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Aug 1999
Posts: 22,221
Member
|
Member
Joined: Aug 1999
Posts: 22,221 |
Not yet, but I hope to get around to this shortly.
Marco Kalter Allround Automations
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Sep 2004
Posts: 29 Bordeaux (France)
Member
|
Member
Joined: Sep 2004
Posts: 29 Bordeaux (France) |
Hi Marco,
I've try the last DOA version : 4.1.2 and the same error still appears.
I would be gratefull if you could resolve this error very shortly and give me a resolution date.
Keep me inform of the advancement of the solution, thanks
-- Hugues
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Sep 2004
Posts: 29 Bordeaux (France)
Member
|
Member
Joined: Sep 2004
Posts: 29 Bordeaux (France) |
Hi Marco,
It would be nice if you could tell me if you are looking at my problem and if a solution could be found very quickly because I must deliver my development at the end of september...
-- Hugues
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Jul 2009
Posts: 2
Member
|
Member
Joined: Jul 2009
Posts: 2 |
Hi !
This problem is very critical...and we are a few having this bug here...
Do you have any solution ? It's been a very long time now...and still no news...
Without any feedback, I think I will search other solutions sooner or later, and leave DOA... I'm a DOA customer since 2002...I would be grateful if you could find a solution to this explicit and clear problem...
Thanks.
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Sep 2004
Posts: 29 Bordeaux (France)
Member
|
Member
Joined: Sep 2004
Posts: 29 Bordeaux (France) |
Hi,
any news about this problem ? it's very important to solve it shortly.
Could you tell me if a solution will be found and when ?
thanks for your answer.
-- Zugg
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Aug 1999
Posts: 22,221
Member
|
Member
Joined: Aug 1999
Posts: 22,221 |
We have no news. Unfortunately this cannot be reproduced.
Marco Kalter Allround Automations
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Sep 2004
Posts: 29 Bordeaux (France)
Member
|
Member
Joined: Sep 2004
Posts: 29 Bordeaux (France) |
Hi Marco,
thanks for you reply.
It is to possible to send me your test application (DLL program and the program using this DLL sending an OracleSession) in order to compare it with my complete program.
Could you tell me with wich Oracle version, Delphi, DOA you have done your test ?
-- Zugg
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Sep 2004
Posts: 29 Bordeaux (France)
Member
|
Member
Joined: Sep 2004
Posts: 29 Bordeaux (France) |
Hi Marco, any news ?
It seems that error is due to session reconnection: 1- OracleSession.Connected := true; 2- loading DLL and pass OracleSession in parameter in order to share the session between my application and my dll 3- close OracleSession in my application: OracleSession.Connected := false; my DLL is always load in memory 4- reconnection: OracleSession.Connected := true; => error appears
In my DLL I have a datamodule wich contains TOracleQuery and TOracleDataSet and when I load the DLL, I link TOracleQuery/TOracleDataSet with my OracleSession application. When I delete this link, error will not always appear.
How can I share TOracleSession with an application and a DLL ?
Last edited by Zugg; 09/01/11 07:37 AM.
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Aug 1999
Posts: 22,221
Member
|
Member
Joined: Aug 1999
Posts: 22,221 |
No news. You can download a little App/DLL session sharing demo here: http://www.allroundautomations.com/download/dlldemo.zip
Marco Kalter Allround Automations
|
|
|
Re: Incorrect Class Transtype at the LogOn
|
Joined: Sep 2004
Posts: 29 Bordeaux (France)
Member
|
Member
Joined: Sep 2004
Posts: 29 Bordeaux (France) |
Thanks for this demo, I'll take a look to see how it works and compare it with my dll code.
Last edited by Zugg; 09/05/11 08:04 AM.
|
|
|
|
|
|