Hallo!
Sehe ich das richtig, dass Du die ibobjects verwendest?
Dann geht das eigentlich ganz einfach:
- in der
DLL eine eigene TIB_Connection einfügen
- eine Initialisierung bauen, in der das dbhandle der TIB_Connection des Haupotprogramms an die
DLL übergeben wird, dann der Property dbHandleShared der TIB_Connection in der
DLL dieses
Handle zuweisen.
Jason hat dazu auch eine Anleitung veröffentlicht:
Zitat:
When trying to share a connection DON'T try to share the reference to the IB_Connection component. Give every
DLL its own TIB_Connection and simply share the connection
handle between them. Use the dbHandle property and assign the value from it to the dbHandleShared property of the TIB_Connection components in the
DLL instances. Use whatever means you want to pass the value, since it is just a simple integer.
One vital point: close the TIB_Connection in the EXE before you terminate or destroy the
DLL calls. Releasing the
DLL resources before you close the TIB_Connection can cause some messy problems at termination!
(Jason Wharton)
und noch eine Anmwerkung von mir: die Connection im Hauptprogramm muss connected sein, wenn man das
Handle übergibt. Sonst klappt nichts.
Hope it helps
onlinekater