Passing Fox arrays by ref or value

This forum is meant for questions about the Visual FoxPro Language support in X#.

User avatar
robert
Posts: 4261
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Passing Fox arrays by ref or value

Post by robert »

Karl-Heinz,
I am not sure why you really want to write your own printer dialog.
I think that most users would be perfectly happy with the normal printer dialog that is shown by the .net PrintDialog class.
this has a property button and everything you could ever want.
You can also enable / disable the various print range options with the properties on that class:
printdlg.png
printdlg.png (9.43 KiB) Viewed 1673 times

Code: Select all

VAR dlg := PrintDialog{}           
    dlg:AllowSelection := TRUE
    dlg:AllowSomePages := TRUE
    dlg:ShowDialog()

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

Passing Fox arrays by ref or value

Post by Karl-Heinz »

Robert,

since the APrinters()/Getprinter() internals are similar, and the .net PrintDialog can´t be customized to get the VFP look i tried it this way. But it´s ok, to stay with the .net Printdialog.

regards
Karl-Heinz
User avatar
robert
Posts: 4261
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Passing Fox arrays by ref or value

Post by robert »

Karl-Heinz

VFP is 12 years old (at least). Why would you try to customize the dialog to look like an antique dialog, unless you're an archelogist ?

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

Passing Fox arrays by ref or value

Post by Karl-Heinz »

Robert,

The .net PrintDialog caption shows "Print", which i translate to: The intention is to print something after clicking the [Ok] button, and not to select a Printername only like the VFP GetPrinter() does. I think in the terms of VFP the GetPrinter() is used in this way:

Code: Select all

c = GetPrinter()

if ! empty ( c ) 
   SET PRINTER TO NAME ( c ) 	

endif


Anyway, from my side the case is closed !

regards
Karl-Heinz
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

Passing Fox arrays by ref or value

Post by Karl-Heinz »

Robert,

after reading your reply once again, I still don't understand why you call me an "archelogist" when I try to point out possible VFP compatibility problems. If you don't like such reports, please say it loud so I don't waste my time any longer!

regards
Karl-Heinz
User avatar
robert
Posts: 4261
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Passing Fox arrays by ref or value

Post by robert »

Karl-Heinz,

I am sorry if I have offended you. That was never my intention.
What I tried to say was that we should not spend too much time to create exactly the same dialog that VFP has, when there is already a built-in dialog in Windows that you can call from C# which also has more functionality (like access to the properties dialog).
By using the built-in dialog we will also "automatically" get new features when they arrive with updates of the OS.

And I do not think that FoxPro has created a complete new dialog. I am pretty sure that the underlying code uses the
PrintDlgA () function in the windows API and all they have done is to pass in PRINTDLGA structure that contains a a handle to a custom resource.

The rest is driven by the normal PrintDlgA() function.

You can see that resource if you open VFP9ENU.DLL in Visual Studio (with Open / File) and then expand the Dialog node in the resource viewer. The resource with number 1559 is the one that contains the dialog.
As you can see in the image below they have moved the properties button outside of the visual area of the dialog, as well as the choices for paper size and source and orientation.
printdlg.png
printdlg.png (10.74 KiB) Viewed 1673 times
I think if we want to do something similar we should use the standard print dialog and use a similar trick to send in a different template.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Chris
Posts: 4584
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Passing Fox arrays by ref or value

Post by Chris »

Hi Karl-Heinz,

Sorry for stepping in, but please be assured that Robert was joking, it was not meant in an offensive way at all. I know, in written text it's hard to tell intent sometimes, but knowing Robert in person well, I know he is typing/saying it in a light-hearted way.

.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

Passing Fox arrays by ref or value

Post by Karl-Heinz »

ok, may love and peace reign again ;-)

Karl-Heinz
User avatar
Chris
Posts: 4584
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Passing Fox arrays by ref or value

Post by Chris »

Karl-Heinz wrote:ok, may love and peace reign again ;-)
:)
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Post Reply