Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Passing a TDBIsamSession component to a DLl
Fri, Nov 1 2013 4:06 AMPermanent Link

Peter Lee

I am having to put some code into a DLL and one of the routines needs to have a Session component passed to it.  I am finding that it appears that some of the properties don't appear to arrive at the dll, PrivateDir being one.  I am using the register option for parameter passing.  What am I doing wrong?

Peter
Mon, Nov 4 2013 9:47 AMPermanent Link

Matthew Jones

I'd say either you are passing the object pointer and it is all there, or you
aren't. Looks like you aren't!

/Matthew Jones/
Tue, Nov 5 2013 3:53 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Peter,

<< I am having to put some code into a DLL and one of the routines needs to
have a Session component passed to it.  I am finding that it appears that
some of the properties don't appear to arrive at the dll, PrivateDir being
one.  I am using the register option for parameter passing.  What am I doing
wrong? >>

You can't pass object instances between an .exe and a .dll - both the .exe
and the .dll are using different code layouts for the same class, so the
virtual method table pointers won't match up and you'll get junk and/or an
AV.

The only option is to pass a callback function to the .dll and have the .dll
code call the callback when it wants to do something with the session in the
main .exe.

Tim Young
Elevate Software
www.elevatesoft.com
Image