Hi ,
Have you overrided the ToString method of PrinterSettings?
If not, have you tried this code on other machines?
It is strange that I have tried your code on my 3 colleagues' machine and
all work well. (their VS.net also version 2003 Framework 1.1)
Best regards,
Beste
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| Subject: RE: BUG: PrinterSettings.ToString()
| From: Jochen Kalmbach <no********************@holzma.de>
| References: <Xn*********************************@127.0.0.1>
<KY**************@cpmsftngxa06.phx.gbl>
| Message-ID: <Xn*********************************@127.0.0.1>
| User-Agent: Xnews/5.04.25
| X-Face:
#TA[Jae"bdx-+QGJx=d8Gi"CujilO8C4^r,6rco%?.Xk?;y`M?j&$Pmm>%[c!9kDW7m]C~N
bWutCC$vPTUW-"icn`nX:[F"N;mB9}]ABU?Y]tZwmSP{]!
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Date: Wed, 17 Sep 2003 22:59:37 -0700
| NNTP-Posting-Host: 217.7.150.245
| Lines: 1
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFT NGXA05.phx.gbl!TK2MSFTNGP0
8.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:185706
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Jeffrey Tan[MSFT] wrote:
|
| > What is the version of your VS.NET and .Net Framework?
| > I have tried your code, but no exception generated.
| > My VS.net IDE is 2003 Version 7.1.3088, .Net Framework is 1.1
| > Version 1.1.4322
|
| I have the same:
| VS.NET IDE is 2003 Version 7.1.3088
| .NET Frameworrk Version 1.1.4.4322
|
| And the problem really happens...
|
| Greetings
| Jochen
|
|
| >| Unhandled Exception: System.ArgumentException: The value '0' is not a
| >| valid value for the enum 'Duplex'.
| >|
| >| at
| >| System.ComponentModel.EnumConverter.ConvertTo(ITyp eDescriptorContext
| >| context, CultureInfo culture, Object value, Type
| >| destinationType)
| >| at System.ComponentModel.TypeConverter.ConvertToStrin g(Object
| >| value) at System.Drawing.Printing.PrinterSettings.ToString()
| >| at PrinterSettingsBug_CS.Class1.Main(String[] args)
| >|
| >|
| >| Here is a simple example to reproduce the problem:
| >|
| >| <code>
| >| namespace PrinterSettingsBug_CS
| >| {
| >| class Class1
| >| {
| >| [System.STAThread]
| >| static void Main(string[] args)
| >| {
| >| System.Drawing.Printing.PrinterSettings ps = new
| >| System.Drawing.Printing.PrinterSettings();
| >|
| >| System.Console.WriteLine(ps.ToString()); // <===== Exception
| >| *****
| >
| >| }
| >| }
| >| }
| >| </code>
|
| --
| Greetings
| Jochen
|
| Do you need a memory-leak finder ?
|
http://www.codeproject.com/tools/leakfinder.asp
|