Page 1 of 1

In the different versions of TUniQuery use 'Assign'

Posted: Mon 07 Dec 2009 08:28
by cxg417
exe + dll: In the different versions of TUniQuery use 'Assign', there will be problems?
________
FORD EX HISTORY

Posted: Mon 07 Dec 2009 08:59
by Plash
You cannot use the Assign method of TUniQuery if you pass a TUniQuery object from another module to this method.

Posted: Tue 08 Dec 2009 01:08
by cxg417
In ccc.dll: (unidac3.0.0.3)

function GetUniQ: TUniQuery; stdcall;

function GetUniQ: TUniQuery;
begin
UniQuery1.Close;
UniQuery1.SQL.Text:= 'select * from table1';
UniQuery1.Open;
Result:= UniQuery1;
end;

In exe: (unidac4.0.0.1 in the Future)

TGetUniQ=function TUniQuery;stdcall;

function GetUniQuery: TUniQuery;
var HDll: THandle;
PDll: TFarProc;
begin
HDll:= LoadLibrary(pChar('d:\ccc.dll'));
PDll:=GetProcAddress(HDll, 'GetUniQ');
Result:= TGetUniQ(PDll);
end;

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
VirtualTable1.Assign(GetUniQuery);
end;

UniDAC in different versions, 'VirtualTable1.Assign (GetUniQuery);', there is the problem?
________
SUZUKI KATANA SPECIFICATIONS

Posted: Tue 08 Dec 2009 08:57
by Plash
You cannot use the Assign method of TVirtualTable in such way.

Posted: Wed 09 Dec 2009 08:51
by cxg417
Why can not I use? Can you tell me the reason? Because I have now used this way.
________
Dodge tomahawk specifications

Posted: Thu 10 Dec 2009 09:16
by Plash
You cannot pass objects to/from DLL. You can pass only simple types like Integer or String. The only exception is the AssingConnect method of TUniConnection.