Message box in background mode?

This Forum is for the use of 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: Tracker Support, TrackerSupp-Daniel, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Andrew - Tracker Support, Tracker - Clarion Support, John - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Support Staff, moderators

Post Reply
sthoma
User
Posts: 4
Joined: Fri Dec 15, 2006 1:37 pm
Location: Vienna
Contact:

Message box in background mode?

Post by sthoma » Wed Nov 26, 2008 2:42 pm

We have an application that should operate in background mode only, there is no user watching the screen.

Actually now, a "save-as" dialog on the screen, that should not appear.
I suspect that the software is not able to write into the temp-directory, but I don't know why, and I am not sure.
Is there any Trace file where I can see what was going wrong?

I would like to to have an exception, error message or something like this that I can handle.
Siegfried Thoma

Ivan - Tracker Software
Site Admin
Posts: 3587
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Message box in background mode?

Post by Ivan - Tracker Software » Wed Nov 26, 2008 9:49 pm

Did you specify correct parameters to operate without Save As dialog?
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.

filek
User
Posts: 2
Joined: Mon Dec 15, 2008 3:00 pm

Re: Message box in background mode?

Post by filek » Wed Feb 04, 2009 7:37 pm

There seems to some kind of time window when settings written to the registry are not taken (or are not even written when printing starts)....

The previous application was more or less the VB exmaple that came with the SDK.
We've rewritten the app in C++ with the help of the CExAPI SDK Example.

What we are doing is quite simple:

1.) Opening a dialog window with the IE control on it
2.) registering the windows messages "PDFXC3_StartDoc" etc.
3.) Hooking the Window in the registry
4.) load a file into IE and Start printing
5.) When the StartDoc Window message event handler is called set the configuration options in the registry into key "HKEY_CURRENT_USER\\Software\\Tracker Software\\PDF-XChange 3.0\\Drivers\\Control\\%08.08x\\" with the id as specified by the StartDoc message.
... and so on.

In most cases this works perfect, and the document gets automatically printed into the file and with the options as specified in the registry in step 5.)

But some cases the configuration settings from the registry are ignored which leads to the SaveAs popup dialog to appear because no output file and not other options are read from the registry.

It appears the behaviour depends on the time the StartDoc handler takes to write the configuration into the registry. In the worst case, when I block the StartDoc handler using Messagebox() before any writes to the registry, the SaveAs dialog ALWAYS apears.

So, what is the rule here ?
How much time do I have in the StartDoc handler to write into the registry (even when the config is immediately written, the time it takes can vary depending on the system load) ?
Or, what is the correct method to assure printing is not started before the configuration is set ( I get the id in the StartDoc handler and can not write the settings earlier ) ?


In fact, detecting the SaveAs dialog (as mentioned below) is not really the problem. The problem is it just appears randomly during operation !!
This is a huge problem which already caused significant effort to find the possible cause.

Ivan - Tracker Software
Site Admin
Posts: 3587
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Message box in background mode?

Post by Ivan - Tracker Software » Thu Feb 05, 2009 8:21 am

"PDFXC3_StartDoc" message is sent with 1000 ms timeout.
You can also try to set your settings with ID = 0 before printing and set property AutoApply to TRUE.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.

filek
User
Posts: 2
Joined: Mon Dec 15, 2008 3:00 pm

Re: Message box in background mode?

Post by filek » Thu Feb 05, 2009 7:49 pm

Thanks, I will try.

But I'm not using IPCControl, therefore I have no AutoApply property.
I'm setting all registry values and do handle all messages directly in my code.
What does AutoApply do and what would my corresponding actions be ?

Ivan - Tracker Software
Site Admin
Posts: 3587
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Message box in background mode?

Post by Ivan - Tracker Software » Mon Feb 16, 2009 6:01 pm

When AutoApply options is set to true into IPXCControl, this control applies all settings specified before without sending events.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.

Post Reply