Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tif images
Message
 
To
22/04/2004 10:32:06
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00889613
Message ID:
00897738
Views:
26
Sergio,

In the Error event of your form, add code to intercept the error 1429 that you just received when the user clicks on the cancel button. Then you can use aerror() function retrieve the detail information of the error. Then you can look for the message "Cancel was pressed" or "Exception #: 32755". Then you can handle it appropriately. You can add a property called "plPrintCanceled", you can issue a message to the user. For example in the your error event of the form:
LPARAMETERS nError, cMethod, nLine
if m.nError = 1429 ;
then 
    local array laError(7)
    if aerror(laError) > 0 ;
    then 
        if "Cancel was pressed" $ laError(3) ;
        then 
            thisform.plPrintCanceled = .t.
        endif 
        if laError(7)=32755 ;
        then 
            thisform.plPrintCanceled = .t.
        endif 
    endif
endif 
Hope this helps.

Dawa
>Hello Reza,
>
>How can I know when the user clicked the Cancel button on the print dialog box?.
>
>
>Here is the situation.
>When I bring up the print dialog box :
>
>Thisform.kodakImageAdminControl.showPrintDialog(lnHandle)
>
>I am presented with the Print Dialog Box.
>When I click the Cancel button on the Print Dialog box I get the following error :
>
>Error Information:
>
>Visual Foxpro Error: OLE IDispatch exception code 0 from ImgAdmin: Cancel
> was pressed..OLE Error: Cancel was pressedApplication Name:
>ImgAdminApplication Help File: imgocxd.hlpHelp context ID:     401450OLE
>Exception #: 32755
>
>OLE IDispatch exception code 0 from ImgAdmin: Cancel was pressed..
>Error #: 1429
>
>
>The "Thisform.kodakImageAdminControl.showPrintDialog()" method does not return any value.
>
>How can I know when the user click the Cancel button????.
>
>Here is my code for the Print Button on my form:
>
>LOCAL nPrintValueReturn
>*-- get application handle
>DECLARE INTEGER FindWindow	IN Win32API ;
>INTEGER nClass, STRING cName
>
>lcCaption = _screen.Caption
>lnHandle= FindWindow( 0, lcCaption)
>
>thisform.kodakImageAdminControl.image = lcTifFile
>nPrintValueReturn = thisform.kodakImageAdminControl.showPrintDialog(lnHandle)
>
>
>
>Thanks,
>Sergio
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Previous
Reply
Map
View

Click here to load this message in the networking platform