Hallo
Ich habe das Beispiel von Jamal bei mir eingespiel und habe lauter Fehler:
error XS0118: 'printDialog' is a variable but is used like a type
error XS0246: The type or namespace name 'DialogResult' could not be found (are you missing a using directive or an assembly reference?)
error XS0118: 'printDialog' is a variable but is used like a type
error XS0246: The type or namespace name 'DialogResult' could not be found (are you missing a using directive or an assembly reference?)
error XS0246: The type or namespace name 'MessageBox' could not be found (are you missing a using directive or an assembly reference?)
error XS0118: 'printDialog' is a variable but is used like a type
error XS0118: 'printDialog' is a variable but is used like a type
error XS0246: The type or namespace name 'DialogResult' could not be found (are you missing a using directive or an assembly reference?)
error XS0246: The type or namespace name 'MessageBox' could not be found (are you missing a using directive or an assembly reference?)
Muss ich noch was einbinden?
Martin
Windows 11 Drucker auslesen
Moderator: wriedmann
Re: Windows 11 Drucker auslesen
Hi Martin,
It's because the local name and the type name are the same. Please declare and use the LOCAL with another name, for example LOCAL printDlg AS printDialog. For the DialogResult and MessageBox, those are types defined in System.Windows.Forms.dll, please add a (GAC) reference to it and also add a USING System.Windows.Forms in the beginning of your prg.
It's because the local name and the type name are the same. Please declare and use the LOCAL with another name, for example LOCAL printDlg AS printDialog. For the DialogResult and MessageBox, those are types defined in System.Windows.Forms.dll, please add a (GAC) reference to it and also add a USING System.Windows.Forms in the beginning of your prg.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Re: Windows 11 Drucker auslesen
Martin,
You need to include on top of the Form prg:
Let me know if need a full example as X# Visual Studio solution.
You need to include on top of the Form prg:
Code: Select all
USING System.Windows.Forms
USING System.Drawing.Printing
Last edited by Jamal on Thu May 22, 2025 7:32 pm, edited 1 time in total.
Re: Windows 11 Drucker auslesen
Hallo
Ich habe jetzt noch einen Fehler.
Inzwischen habe ich diverse andere Files hinzugefügt. Leider ohne den Fehler weg zu bekommen.
USING System.Drawing.Printing
USING System.Windows.Forms
USING System.Windows.Forms.Design
USING System.Windows.Forms.Layout
USING System.Windows.Forms.VisualStyles
USING System.Windows.Forms.PropertyGridInternal
USING System.Windows.Forms.ComponentModel
USING System.Windows.Forms.ComponentModel.Com2Interop
USING System.Windows.Forms.Automation
USING System.Resources
Eigenlich hatte ich irgendwo System.Windows.Forms.CommonDialog erwartet, aber es gibt nichts.
Ich habe absolut keine Ahnung wie da irgendwas zusammen hängen soll.
Danke Martin
Ich habe jetzt noch einen Fehler.
Inzwischen habe ich diverse andere Files hinzugefügt. Leider ohne den Fehler weg zu bekommen.
USING System.Drawing.Printing
USING System.Windows.Forms
USING System.Windows.Forms.Design
USING System.Windows.Forms.Layout
USING System.Windows.Forms.VisualStyles
USING System.Windows.Forms.PropertyGridInternal
USING System.Windows.Forms.ComponentModel
USING System.Windows.Forms.ComponentModel.Com2Interop
USING System.Windows.Forms.Automation
USING System.Resources
Eigenlich hatte ich irgendwo System.Windows.Forms.CommonDialog erwartet, aber es gibt nichts.
Ich habe absolut keine Ahnung wie da irgendwas zusammen hängen soll.
Danke Martin
Re: Windows 11 Drucker auslesen
Hi Martin,
The compiler reports this error on line 40, please show us this line of code.
The compiler reports this error on line 40, please show us this line of code.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Re: Windows 11 Drucker auslesen
Hallo Martin,
wie was zusammenhängt:
https://docs.xsharp.it/doku.php?id=name ... _reference
Wolfgang
wie was zusammenhängt:
https://docs.xsharp.it/doku.php?id=name ... _reference
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Re: Windows 11 Drucker auslesen
Hallo
Danke Chris. Es läuft. Ich hatte einen Tippfehler.
Danke Worlfgang. ich habe mal da durchgeblättert. Der Aufbau mit den namen ist mir klar. Ansonnsten verstehe ich nur Bahnhof <s>. Da ich mit der Hilfe von Chris mein alte VO Programm nach X# gebracht habe, brauche ich mich in meinem Alten nicht mit .Net beschäftigen. Glücklicherweise schreibe ich ja nur für meine eigene Firma.
Martin
Danke Chris. Es läuft. Ich hatte einen Tippfehler.
Danke Worlfgang. ich habe mal da durchgeblättert. Der Aufbau mit den namen ist mir klar. Ansonnsten verstehe ich nur Bahnhof <s>. Da ich mit der Hilfe von Chris mein alte VO Programm nach X# gebracht habe, brauche ich mich in meinem Alten nicht mit .Net beschäftigen. Glücklicherweise schreibe ich ja nur für meine eigene Firma.
Martin

