memory problem with Stamp annotation

A forum for questions or concerns related to the PDF-XChange Core API SDK

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
aleksand
User
Posts: 11
Joined: Tue Apr 24, 2018 6:55 am

memory problem with Stamp annotation

Post by aleksand »

Hi,

I use c++ coreApi sdk. I implement add Stamp annotation to pdf and after start closing my application problem with memory begin (crash and create hs-* error file) .
I use like code for create new stamp annotation (it is not full but this part is enough for reproduce problem):
PXC::ULONG_T nAtom;
hr = g_COS->StrToAtom(L"Stamp", &nAtom);
PXC::PXC_Rect rcAnnotRect;
setRecAnnot(rcAnnotRect, x, y, w, h, W, H, rot);
CComPtr<PXC::IPXC_Annotation> annot;
hr = pPage->InsertNewAnnot(nAtom, &rcAnnotRect, -1, &annot);

If this part is used my application generate file hs_err_pid*.log. I investigated problem and found that this code is used FinalizeSDK() (from your examples) throw exeption. If name of annotation is changed to "FreeText" for example (hr = g_COS->StrToAtom(L"FreeText", &nAtom); ) FinalizeSDK() do not throw exeption.

p.s. hs_err_pid*.log has not any good info about problem.


Thanks,
Evgeny.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: memory problem with Stamp annotation

Post by Sasha - Tracker Dev Team »

Hello aleksand,

Can you please prepare a small console project to illustrate this behavior?
You can use this project for quick start:
https://github.com/tracker-software/PDF ... eAPISample

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
aleksand
User
Posts: 11
Joined: Tue Apr 24, 2018 6:55 am

Re: memory problem with Stamp annotation

Post by aleksand »

Hi Alex,

Sorry for long answer. I tried to reproduce on your examples (console and mfs), but can not. I investigate more and I hope that I found the problem. I use CoreApi from java like dynamic dlls. The problem is exist only if I do not call finalizaSDK before DllProcessDetach (or call finalizaSDK from DllProcessDetach). It was just a surprise for me that this problem only exists if an attempt is made to add a stamp annotation (other annotations no crash even in case call finalizaSDK in DllProcessDetach).

p.s. I am not sure that it is the bug, because description from Microsoft wrote that use free library in DllProcessDetach is dangerous.

Cheers,
Evgeny.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

memory problem with Stamp annotation

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply