EnabledPre message not sent when using Print Setup dialog

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
Jonners
Posts: 6
Joined: Wed Apr 07 2004
Location: UK

EnabledPre message not sent when using Print Setup dialog

Post by Jonners »

Hello all,

My program uses a Print Setup dialog derived from CPrintDialog. It allows the user to set advanced options (i.e. Printer Properties) on any of the printers installed (just like you would see in any Windows program that has a printing capability).

My problem is that when the user has selected the Amyuni printer from the dropdown list, then presses the "Properties..." button on the dialog, they get the error "Printer not activated, error code -30". Following that, they get the Amyuni printer's configuration dialog.

I think I have two options:
1. Disable the "Properties..." button on the Print Setup dialog when the Amyuni printer is selected. However, this is a complicated Common Dialog and can not easily be rewritten.
2. Enable the Amyuni printer when the "Properties..." button is pressed (which would suppress the error, but still show the configuration dialog). I have tried to do this using the "EnabledPre" message. However, it appears that the "EnabledPre" message is not sent by the Amyuni driver in this case, so my "Enable" code does not get called.

So, should I be able to capture an "EnabledPre" message when the "Properties..." button is pressed in the Common Print Setup dialog?

Thanks,

John
Jonners
Posts: 6
Joined: Wed Apr 07 2004
Location: UK

Post by Jonners »

Hello,

I think my description above was perhaps too detailed and maybe confusing. Let me simplify it:

Is the "EnabledPre" message fired by the Amyuni driver when the user selects the "Properties..." button in MFC's standard "Print Setup" dialog (CPrintDialog class). I want to Enable the Amyuni Printer when this button is pressed in order to suppress the error message box( code - 30).

I hope this simplifies the issue.

Thank you,

John
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

EnablePre is fired whenever the driver needs an activation code so yes in your case EnablePre will be fired.

Hope this helps.
Jonners
Posts: 6
Joined: Wed Apr 07 2004
Location: UK

Post by Jonners »

Joan,

I am able to capture EnabledPre before printing, but not before the "Properties" dialog appears. Maybe there was something wrong with my code.

I have solved my problem in a different way - Deriving a class from CPrintDialog and disabling the "Properties..." button when the Amyuni Printer is selected. Works fine now.

Thanks,

John
Post Reply