Home > Back-end >  Running normally call DLL of Delphi, exit after the call when there is "0 x00000000 unhandled e
Running normally call DLL of Delphi, exit after the call when there is "0 x00000000 unhandled e

Time:10-12

Each prawn, help me see
The code is as follows:
The library faxdll;
USES the
SysUtils,
Windows,
//Dialogs,
Classes;

Type
Address=Record
Name, Company, Adr, the Location, Fax, Tel, Owner: TStringList;
The End;
The JobInfo=Record
Sender, Recipient, Address;
STime ETime, RTime, Subject, Comment,
NotifyAdr, TagLine, PageChop Coverpage,
CountCoverPage, Modem: String;
Dials, Tries, Prio, PRes, ChopThreshold,
PForm, Notify, Pages: Byte;
WCover WCountCover, WTagline: Boolean;
Docs, Dests: TStringList;
JobID: TStringList;
JobTag: String;
end;
The function mySendFax (HD: THandle; Const FaxPath: string; Const sServer sUser, sPass: string;
Const iPort: Integer; Const sinfo: string; Const sFileName: string; Var AJobInfo: JobInfo;
Var sError: string; Const sLoginUser: string=') : Boolean; stdcall; External 'SendFax. DLL';


The Function mysend (X: integer; FAX_PHONE FAX_SERVER, FAX_SJR FAX_FJR, FAX_FILE: pchar) : integer; Stdcall;
Var
AJobInfo: JobInfo;
SError sinfo, _FaxDataPath, aa: string;
Bol: Boolean;
K: THandle;
The begin
Try

_FaxDataPath:='C:';
Sinfo:='111' + # 9 + 'NOW' + # 9 + 'FJR' + + # 9 # 9 + ' '+' SJR '+ + # 9 # 9 +' + '+ + # 9 # 9 +' + 'ttyS4' + # 9 + 'test' + # 9 + '1' + # 9 + + # 9 + '1', '127'.

K:=THandle (X);
Bol=mySendFax (k, 'C:', '10.141.37.200', '000185', '123456', 0, sinfo, 'C: \ 111. TXT, AJobInfo, sError, ");
Aa:=BoolToStr (Bol);
Result:=strtoint (aa);
Except,
Result:=0;
end;
end;

{$R *. RES}
Exports mysend;
The begin

end.

CodePudding user response:

Have no one to help me see ah

CodePudding user response:

CodePudding user response:

In the caller and DLL are USES ShareMem, exe to, also in the DLL, and must be first, and USES the other USES of the unit are followed, string, etc. These types of automatic management life cycle need borlandmm DLL to achieve management,
If the program release, BORLNDMM. DLL, if can't take BORLNDMM DLL, can use fastmm, USES ShareMem into USES fastmm; Release program can not bring BORLNDMM. DLL,

Of course you can also write a memory manager, "Delphi technology handbook" has a custom implementation in the memory manager example code,

CodePudding user response:

Thank you so much! Now the problem is' SendFax. DLL this DLL is not I write,

CodePudding user response:

Who give a specific method, not very grateful!

CodePudding user response:

reference 4 floor SSZHJ_023 response:
thank you! Now the problem is' SendFax. DLL this DLL is not I write,
can't cough up, since there is something wrong with the DLL can only find the author

CodePudding user response:

DELPHI call normal, the problem should be in the interface section,

CodePudding user response:

See if you have no free memory, this may also appear this mistake
  • Related