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
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.050s Queries: 13 (0.006s) Memory: 2.5627 MB (Peak: 3.0424 MB) Data Comp: Off Server Time: 2024-05-20 20:22:26 UTC
Valid HTML 5 and Valid CSS