Ok on with the dll part of the project. The help file threw me for a while till I found that the stdcall directive needs to be in the calling definitions as well as in the library.
Anyway calls to simple things {e.g the help sample} work Ok.
But this just hangs. consuming more and more resources until doomsday.
'memrecv' is a stringlist declared as a global in the datamodule. The external call is suppose to create it ready for use [no passing in or out is involved], but it just hangs.
I took the try except out so it will always return 0.
I don't know if you can use try/except in dlls?
calling program looks like this
assuming this can be fixed? the next stage is to get the TTcpServer/TTcpclient components to work (these are in the data module) the help says this
The demo seems to have 'Q' prefix versions of all the normal librarys in its uses clause, what is the difference?
The code server recieve code (from the demo) involves threading, again daddy asked somone if there dll involved multithreading but there was no answer, what are the implications?
Steve [The sane]: Delphi a feersum engin indeed.
Anyway calls to simple things {e.g the help sample} work Ok.
But this just hangs. consuming more and more resources until doomsday.
'memrecv' is a stringlist declared as a global in the datamodule. The external call is suppose to create it ready for use [no passing in or out is involved], but it just hangs.
I took the try except out so it will always return 0.
I don't know if you can use try/except in dlls?
Code:
library Ethernet;
{ To avoid using sharemempass string information using PChar or ShortString parameters. }
uses
SysUtils,
Classes,
dataUnit in 'dataUnit.pas' {DataModule1: TDataModule};
{$R *.res}
function Initalise: integer; stdcall;
begin
result := 0;
MemRecv := memRecv.Create; // create a string list to hold recived messages
end;
calling program looks like this
Code:
function Initalise: integer; stdcall; external 'Ethernet';
function ActivateServer(LocalP: shortstring;
RemoteH: shortstring;
RemoteP: shortstring): integer; stdcall; external 'Ethernet';
procedure Send(S: shortstring); stdcall; external 'Ethernet';
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
try
if Initalise > 0 then
showmessage('Initalisation Error')
except
showmessage('Error in Dll');
end;
end;
assuming this can be fixed? the next stage is to get the TTcpServer/TTcpclient components to work (these are in the data module) the help says this
Does this apply here?delphi help said:Note
If your application includes VisualCLX components, you must use packages instead of DLLs or shared objects. Only packages can manage the startup and shutdown of the Qt shared libraries.
The demo seems to have 'Q' prefix versions of all the normal librarys in its uses clause, what is the difference?
The code server recieve code (from the demo) involves threading, again daddy asked somone if there dll involved multithreading but there was no answer, what are the implications?
Steve [The sane]: Delphi a feersum engin indeed.