Report Writer example misbehaving when compiled as .DLL

This Forum is for the use of Clarion For Windows - Software Developers requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers SDK (only) - Please use the PDF-Tools SDK Forum for Library DLL assistance.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators

Post Reply
Bradnams
User
Posts: 26
Joined: Fri Jan 21, 2005 2:30 am
Location: Australia
Contact:

Report Writer example misbehaving when compiled as .DLL

Post by Bradnams » Thu Jul 28, 2005 5:35 am

Please see the attached example. APPs have been converted to use the Clarion template chain.

When crwpxc30cla.app is compiled as an EXE, the code extension behaves as expected. When compiled as a DLL and TestRW is called from another EXE the output PDF contains demo watermarks and none of the code template settings seem to be obeyed (e.g. ShowSaveDialog = false, FullFileName, WhenExists=overwrite).

crwpxc30cla.exe (crwpxc30cla.app)- shows the code extension behaving as expected
callcrwpx.exe (callcrwpx.app)- shows the code extension misbehaving

Regards.
Attachments
RWExample.zip
Report Writer example
(92.46 KiB) Downloaded 379 times

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Post by Tracker - Clarion Support » Thu Jul 28, 2005 12:04 pm

Hi Bradnams!

Checking now!

Thanks!
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Post by Tracker - Clarion Support » Thu Jul 28, 2005 9:03 pm

Hi Bradnams!

We have identified the cause of the problem. Some vital initialization code that generatess at the program level is not being executed when the app is compiled as a dll.

I think I can produce a satisfactory solution in a day or less.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

Bradnams
User
Posts: 26
Joined: Fri Jan 21, 2005 2:30 am
Location: Australia
Contact:

Post by Bradnams » Fri Jul 29, 2005 12:16 am

Hi Craig,

Thanks for your speedy reply. Look forward to seeing your solution.

Thanks.

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Post by Tracker - Clarion Support » Fri Jul 29, 2005 3:39 pm

Hi Bradnams!

I believe the attached files will correct your problem.

-- Craig
Attachments
pdfxdv30.zip
Corrected for DLL operation:
pdfxdv30.inc
pdfxdv30.clw
pdfxdv30.tpl
(27.3 KiB) Downloaded 318 times
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

Bradnams
User
Posts: 26
Joined: Fri Jan 21, 2005 2:30 am
Location: Australia
Contact:

Post by Bradnams » Mon Aug 01, 2005 12:27 am

Thanks for the updated files.

The new code, as attached, didn't fix the issue and actually broke the previously working implementation for .EXEs! I was able to get the code to work (DLL and EXE) by commenting-out the line 103 in pdfxdv30.clw in the PDFXC3_GlobalInit procedure:

Code: Select all

timefld = IntToHex(CLOCK(),8)
A snippet of the surrounding code now looks like:

Code: Select all

  FREE(GLO:WindowQueue)
  ! timefld = IntToHex(CLOCK(),8)
  cstr1 = CLIP(PDFXC3_StartDoc)&timefld
  GLO:StartDocMsg = RegisterWindowMessage(cstr1)
  cstr1 = CLIP(PDFXC3_EndDoc)&timefld
  GLO:EndDocMsg = RegisterWindowMessage(cstr1)
  cstr1 = CLIP(PDFXC3_DocSaved)&timefld
  GLO:DocSavedMsg = RegisterWindowMessage(cstr1)
After intercepting some window messages I noticed that StartDoc, EndDoc, etc messages had been registered in the shorter form. Presumably the message values returned from RegisterWindowMessage() aren't being successfully passed to the library. Are any other updated files required?

Also, is it safe to use the shorter form? I haven't delved into the implementation, so I'm not sure whether library callers are identified by calling window handle or a message parameter, or something else. The application using this functionality will not be generating more than one pdf output concurrently.

Thanks again for your speedy responses.

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Post by Tracker - Clarion Support » Mon Aug 01, 2005 1:40 pm

Hi Bradnams!

No that is NOT correct.

Somehow you got an earlier test version.

Attached are the correct class files.

I am terribly sorry we made that error.
Attachments
pdfxdv30class.zip
pdfxdv30.inc
pdfxdv30.clw
Corrrected for proper messaging
(10.28 KiB) Downloaded 315 times
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

Post Reply

Return to “PDF-XChange Drivers (only) API SDK - For Clarion For Windows Developers only Please”