[Solved] Abnormal end at the call of the function Sendmail

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
Deurges
Posts: 7
Joined: Fri Jan 24 2003

[Solved] Abnormal end at the call of the function Sendmail

Post by Deurges »

My application crashes at the call of the function Sendmail with the following error message.

German:
Die Anweisung in "0x77ead7e1" verweist auf Speicher in "0x0000000f". Der Vorgang "read" konnte nicht auf dem Speicher durchgeführt werden. :evil:

Translated:
The statement in "0 x77ead7e1" refers to memory in "0 x0000000f". The process "read" couldn't be executed on the memory. :evil:

It must be connected with the handing over of the parameters. (To, CC, BCC, Subject, Message)
My mail client starts quite normally if I submit empty strings.
"gatc_CDIntf.CDIntf".SendMail('', '', '', '', '', gtx_Filename, 2);

First the handing over with "filled" strings still has worked. Only after repeated use the application behaved as just described.

Does anybody have an idea? :?:

Operating system: Windows NT & Windows 2000
CDIntf.dll : 208a

My code enclosed.

lin_NoPrompt := 1;
lin_UseFileName := 2;
lin_SendByEmail := 2048;

gtx_FileName := STRSUBSTNO('C:\%1.pdf', vtx_Filename);

CLEAR("gatc_CDIntf.CDIntf");
CREATE("gatc_CDIntf.CDIntf");

"gatc_CDIntf.CDIntf".PDFDriverInit('Amyuni PDF Converter');
"gatc_CDIntf.CDIntf".PaperSize := 9;
"gatc_CDIntf.CDIntf".Orientation := 1;
"gatc_CDIntf.CDIntf".SetDefaultConfig;

"gatc_CDIntf.CDIntf".SetDefaultPrinter;
"gatc_CDIntf.CDIntf".DefaultDirectory := 'C:\';
"gatc_CDIntf.CDIntf".DefaultFileName := gtx_Filename;

"gatc_CDIntf.CDIntf".FileNameOptions := lin_NoPrompt + lin_UseFileName;

"gatc_CDIntf.CDIntf".SendMail(ltx_To, ltx_CC, ltx_BCC, ltx_Subject, ltx_Message, gtx_Filename, 2);

"gatc_CDIntf.CDIntf".FileNameOptions := 0;
"gatc_CDIntf.CDIntf".RestoreDefaultPrinter;
"gatc_CDIntf.CDIntf".DriverEnd;

CLEAR("gatc_CDIntf.CDIntf");
Deurges
Posts: 7
Joined: Fri Jan 24 2003

Bug in Code

Post by Deurges »

Hi,
I have found the solution.
The bug lay on my site.

The DefaultFileName and Sendmail Filename parameter have the same Filename.

Wrong:

gtx_FileName := 'C:\MyPDF.pdf.';

"gatc_CDIntf.CDIntf".DefaultFileName := gtx_FileName;
"gatc_CDIntf.CDIntf".SendMail(ltx_To, ltx_CC, ltx_BCC, ltx_Subject, ltx_Message, gtx_Filename, 2);

Right

gtx_FileName := 'C:\MyPDF.pdf.';
gtx_EmailAtt := 'C:\MyPDF.pdf.;C:\MyPDF.pdf';

"gatc_CDIntf.CDIntf".DefaultFileName := gtx_FileName;
"gatc_CDIntf.CDIntf".SendMail(ltx_To, ltx_CC, ltx_BCC, ltx_Subject, ltx_Message, gtx_EmailAtt, 2);
Post Reply