The P/Invoke Interop Assistant (http://www.codeplex.com/clrinterop)
generates a signature for GetDefaultPrinter using an uint type for
pcchBuffer:
public static extern bool GetDefaultPrinter([OutAttribute()]
[MarshalAsAttribute(UnmanagedType.LPStr)] StringBuilder pszBuffer, ref
uint pcchBuffer);
However, StringBuilder only accepts type int. Is it safe to cast uint to
int?
The GetDefaultPrinter signature on pinvoke.net uses an int type for
pcchBuffer, so a cast is not necessary.
Thanks,
Tim Sprout