Hi Shmuel,
Welcome to MSDN newsgroup.
As for the PInvoke problem you mentioned , based on my experience, it's
likely due to the Charset you set in the function declaration. As you've
pasted in the former message , you used the following function declaration:
[ DllImport( "winspool.drv",CharSet=CharSet.Ansi,ExactSpelling= true,
CallingConvention=CallingConvention.StdCall)]
public static extern long WritePrinter(IntPtr hPrinter,string data, int
buf,ref int pcWritten);
CharSet=CharSet.Ansi, means the runtime will use the ANSI code page to
convert the .net's unicode string, so when there're non-ascii chars, .net
will use the machine's System Locale to convert the string into Multi Byte
chars. So as for the
hebrew letters, if your machine's System Locale is not set to a correct
hebrew charset , the result chars will become corrupted. I think you can
try changing the Charset to CharSet.Unicode or CharSet.Auto :
1. CharSet.Uncode means runtime will convert string to wide chars(in
unmanaged code)
2. CharSet.Auto means runtime will determine whether to convert string into
Wide Chars or MUlti Bytes chars according to the machine support for
unicode.
For more detail info, you can refer to the following msdn document:
#CharSet Enumeration
http://msdn.microsoft.com/library/en...runtimeinterop
servicescharsetclasstopic.asp?frame=true
Hope helps. Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)