#1 2015-05-19 23:00:02

alank
Member
Registered: 2015-05-19
Posts: 3

Access violation in TSynAnsiFixedWidth.WideCharToAnsiChar()

I've got a bedevilling error that is simply driving me nuts. We have a two (2) products that generate a single page PDF form as output, one a desktop Windows application, and the other is it's web based equivalent (an ISAPI DLL). This page contains text and some rounded rectangles, but is not graphics nor memory intensive.

In the web based product, I am experiencing an access violation in TSynAnsiFixedWidth.WideCharToAnsiChar(). It appears as if the fAnsiToWide dynamic array is not available or hasn't been defined yet. The relevant stack trace is:

SynCommons.TSynAnsiFixedWidth.WideCharToAnsiChar(32)
SynPdf.TPdfFontTrueType.GetWideCharWidth(' ')
SynPdf.TPdfCanvas.UnicodeTextWidth(' ')
SynPdf.TPdfEnum.TextOut($530B5B4)
SynPdf.EnumEMFFunc(587271252,((71703579)),$530B5B4,4,$5DB71F0)
:750559b4 ; C:\Windows\syswow64\GDI32.dll
SynPdf.TPdfCanvas.RenderMetaFile(???,1,0,0,???,99,99)

The desktop Windows application functions fine, and the web based application also functions well under certain configurations. Are there any memory considerations I should heed when using SynPDF in an ISAP DLL? Would using TPdfDocument instead of TPdfDocumentGDI be less of a memory burden?

Thanks much for any light you might be able to shed on this,
  Alan

Offline

#2 2015-05-20 05:25:05

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Access violation in TSynAnsiFixedWidth.WideCharToAnsiChar()

Are you using latest synpdf source from http://synopse.info/files/mORMotNightlyBuild.zip ?

Offline

#3 2015-05-20 13:53:38

alank
Member
Registered: 2015-05-19
Posts: 3

Re: Access violation in TSynAnsiFixedWidth.WideCharToAnsiChar()

I've tried both the latest stable and latest nightly builds (I am using SynPdf.zip, not the entire framework) - same problem occurs with both. I'm compiling under Delphi XE3, targeting the 32-bit platform.

Alan

Last edited by alank (2015-05-20 13:55:37)

Offline

#4 2015-05-20 17:27:23

alank
Member
Registered: 2015-05-19
Posts: 3

Re: Access violation in TSynAnsiFixedWidth.WideCharToAnsiChar()

I resolved the issue in my code - memory was getting stomped and it wasn't showing up until the PDF was trying to be created. 8+ hours of debugging, and at least I have a working product now. ;>

Alan

Offline

#5 2015-05-20 19:39:43

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Access violation in TSynAnsiFixedWidth.WideCharToAnsiChar()

So were was the problem, finally?

Offline

Board footer

Powered by FluxBB