Print Thread
Page 1 of 2 1 2
Incorrect Class Transtype at the LogOn
#33642 03/19/09 04:32 PM
Joined: Mar 2009
Posts: 1
L
Laurent Offline OP
Member
OP Offline
Member
L
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
Laurent #33649 03/20/09 12:28 PM
Joined: Aug 1999
Posts: 22,221
Member
Offline
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
Marco Kalter #33889 04/28/09 12:20 PM
Joined: Sep 2004
Posts: 29
Bordeaux (France)
Z
Member
Offline
Member
Z
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
Zugg #33935 05/05/09 07:46 AM
Joined: Sep 2004
Posts: 29
Bordeaux (France)
Z
Member
Offline
Member
Z
Joined: Sep 2004
Posts: 29
Bordeaux (France)
No idea for a solution of my problem ?

--
Hugues

Re: Incorrect Class Transtype at the LogOn
Zugg #33936 05/05/09 10:08 AM
Joined: Aug 1999
Posts: 22,221
Member
Offline
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
Marco Kalter #33944 05/06/09 08:00 AM
Joined: Sep 2004
Posts: 29
Bordeaux (France)
Z
Member
Offline
Member
Z
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
Zugg #33946 05/06/09 12:31 PM
Joined: Aug 1999
Posts: 22,221
Member
Offline
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
Marco Kalter #33952 05/06/09 03:25 PM
Joined: Sep 2004
Posts: 29
Bordeaux (France)
Z
Member
Offline
Member
Z
Joined: Sep 2004
Posts: 29
Bordeaux (France)
ok great
thanks

--
Hugues

Re: Incorrect Class Transtype at the LogOn
Zugg #34099 05/28/09 07:26 AM
Joined: Sep 2004
Posts: 29
Bordeaux (France)
Z
Member
Offline
Member
Z
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
Zugg #34100 05/28/09 11:49 AM
Joined: Aug 1999
Posts: 22,221
Member
Offline
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
Marco Kalter #34361 07/09/09 07:37 AM
Joined: Sep 2004
Posts: 29
Bordeaux (France)
Z
Member
Offline
Member
Z
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
Zugg #35098 08/31/09 07:33 AM
Joined: Sep 2004
Posts: 29
Bordeaux (France)
Z
Member
Offline
Member
Z
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
Zugg #35788 09/30/09 08:38 AM
Joined: Jul 2009
Posts: 2
S
Member
Offline
Member
S
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
Sweet #37570 03/11/10 08:39 AM
Joined: Sep 2004
Posts: 29
Bordeaux (France)
Z
Member
Offline
Member
Z
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
Zugg #37572 03/11/10 10:29 AM
Joined: Aug 1999
Posts: 22,221
Member
Offline
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
Marco Kalter #37604 03/16/10 08:33 AM
Joined: Sep 2004
Posts: 29
Bordeaux (France)
Z
Member
Offline
Member
Z
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
Zugg #42053 09/01/11 07:31 AM
Joined: Sep 2004
Posts: 29
Bordeaux (France)
Z
Member
Offline
Member
Z
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
Zugg #42054 09/01/11 08:59 AM
Joined: Aug 1999
Posts: 22,221
Member
Offline
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
Marco Kalter #42065 09/05/11 08:03 AM
Joined: Sep 2004
Posts: 29
Bordeaux (France)
Z
Member
Offline
Member
Z
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.
Page 1 of 2 1 2

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.032s Queries: 13 (0.007s) Memory: 2.6068 MB (Peak: 3.0430 MB) Data Comp: Off Server Time: 2024-05-20 20:59:50 UTC
Valid HTML 5 and Valid CSS