I have a following method declaration in VB and need to translate it into C#:
<DllImport("winspool.Drv", EntryPoint:="OpenPrinterW", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function OpenPrinter(ByVal src As String, ByRef hPrinter As IntPtr, ByVal pd As Int16) As Boolean
End Function
Particularly I am not sure if it the ByRef
argument specifier is equivalent to ref
is C#.
Also I don't know if Shared == static
and whether it must be extern
.
Probably lot of you are proficient in both VB and C#, so I'd be grateful for providing correct declaration in C#.