Wrappers for Delphi 2010

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics or PDF-XChange Viewer SDK if appropriate.

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

Post Reply
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Wrappers for Delphi 2010

Post by jeffp »

I'm in the process of porting my code from Delphi 2007 to Delphi 2010 and have encountered some issues relating to your Delphi wrappers.

As of Delphi 2009, Delphi supports Unicode and in doing so they changed some of the types. The big change is that PChar is now mapped to PWideChar where it used to be mapped to PAnsiChar.

I discovered this when I put your code in Delphi 2010 and kept getting the demo watermarks on all my PDF. I found out that the cause of this was because your procedures that relate to the RegKey and DevCodes in your Delphi wrappers use PChar. So in 2007 that meant PAnsiChar but in 2010 in meant PWideChar, which caused in not to work in D2010.

I got it working by changing all the PChar in your Delphi wrappers to AnsiString.

I'm not sure if this will mess other procedures up but it does seem to work with the procedures that require the RegKey and DevCode.

Do you have updated Delphi wrappers that have been tested on both D2007 and D2010 (I didn't see any in your latest SDK builds)? If not, you might want to look into this issue.

--Jeff
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: Wrappers for Delphi 2010

Post by John - Tracker Supp »

Hi Jeff,

will try and get these available tomorrow if possible and will advise when ready.

please nudge me by a repost if you have not heard by lunchtime ..
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: Wrappers for Delphi 2010

Post by jeffp »

Don't hurry on my account since I've got something working for now. I just know this will come up as more Delphi developers move to D2010 and beyond and have to deal with the Unicode headaches that I've been though this week.

Again, in converting yours and other Delphi wrappers around windows DLLs, the best solution seems to be to change PChar type to AnsiString and then it works for all versions of Delphi.
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: Wrappers for Delphi 2010

Post by John - Tracker Supp »

Hi Jeff,

the strange thing is - apparently we have these and use them ourselves for various tools (C#, DOTNET, Delphi etc) for creating our own examples - but no one ever told me and we have never distributed - we will be doing so in the very near future now I know with the SDK's by default ;)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: Wrappers for Delphi 2010

Post by jeffp »

Maybe the conversion is PChar to PAnsiChar instead of AnsiString.

Attached is an article widely cited on the changes in Delphi 2010. Your dev guys will understand all this much better than I.

Let me know when you have the new wrappers done and I'll test them out for you on both versions of Delphi.
Attachments
Delphi 2010 Strings.pdf
(163.28 KiB) Downloaded 182 times
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: Wrappers for Delphi 2010

Post by John - Tracker Supp »

Thanks Jeff,

I was not available to chase this up yesterday - will do so first thing Monday.
thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
Post Reply