如果主窗体里的TSQLCONNECTION叫connA,传递一个pointer(connA)到DLL里
DLL里直接就初始化成
Sds_Mx.connection=connA;
也就是说只要传递过去指向这个CONNECTION就行了。
FUNCTION ProvaChild(ParentApplication: TApplication
ParentForm: TForm;
OraSession: pointer
aCaption: STRING): Tform
EXPORT
STDCALL;
在里面我就是用这个初始化的,我用的ODAC
WITH childfrm DO
TRY
FOR i := 0 TO ComponentCount - 1 DO
IF (Components IS toraquery) THEN
toraquery(Components).Session := OraSession
ELSE
IF (Components IS TOraSQL) THEN
TOraSQL(Components).Session := OraSession
ELSE
IF (Components IS TOraStoredProc) THEN
TOraStoredProc(Components).Session := OraSession;