Crash in malloc() call from PDF control.

If you are a C/C++/C# developer and have any questions about using our products from your application here is the place to post them.
Post Reply
beandog
Posts: 33
Joined: Wed Dec 14 2005

Crash in malloc() call from PDF control.

Post by beandog »

My viewer app was crashing spontaneously and erratically, and I reduced the problem to the following:

Create a new MFC project in Visual Studio 2003, SDI interface, FormView. On the form, put the PDF control. Add the PDF control as a variable to the form named PDF. Then, in the double-click event of the form (or a button, or whatever), do the following code:

PDF.SetLicenseKey(
"Your license", "your key"
);

int i;
PDF.InitBlank();
for(i = 0; i < 200; i++)
PDF.AddPage(0);
PDF.Save("Long.pdf", 0);

PDF.InitBlank();
for(i = 0; i < 50; i++)
PDF.AddPage(0);
PDF.Save("Short.pdf", 0);

PDF.InitBlank();
PDF.Open("Long.pdf", "");
PDF.put_CurrentPage(PDF.get_PageCount());

PDF.Open("Short.pdf", "");
for(int i = 0; i < PDF.get_PageCount(); i++)
PDF.put_CurrentPage(PDF.get_PageCount()-i);

It creates and saves a long pdf (200 pages), then a short pdf (50 pages). It re-initializes a blank PDF, then loads the long PDF, navigates to the last page, opens the short PDF, and navigates to each page starting at the end and moving toward the beginning. Partway through the last loop, the application crashes in a malloc() call from the PDF viewer.

This was happening whenever I'd open a long PDF, navigate to the end, open a shorter PDF, and navigate through its pages. I made this code to see if it was reproducible with empty PDF's of appropriate length.

I've posted the ActiveX DLL that I'm using at http://www.beandogsoft.com/downloads/pdfcreactivex.dll for your reference.

I'm using Visual Studio 2003, so the memory library is msvcr71d.dll.

I'd appreciate any feedback on this problem.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

I checked the version of the dll you have. It is version 2.0. I suggest that you try our latest release 2.0f or you can wait a little bit (1 to 2 weeks) and download the new 2.0g that will be online.

If the issues you are facing where not solved using the new version please let us know.
beandog
Posts: 33
Joined: Wed Dec 14 2005

Solved!

Post by beandog »

Yes, the problem was solved in 2.0f. Thanks for the heads up.
Post Reply