D
**Developer**
Notice below I sometimes used the "A" version. I found by cut-and-try that
only the "A" version would work correctly. Anyone have a suggestion of why
the "W" version would not work correctly?
One reason is that the ByRef or ByVal does not show by InteliSence so the
"p" would help there.
------
Secondly, I'd like to be consistent with the parameter names. I'd like to
precede with a "p" if ByRef or if a pointer is expected, whichever make more
sense.
Which is better to use?
If a string is passed by value should the variable strat with a "p"?
What about an IntPrt variable?
It would be a good example if someone would fix the parameter names below.
----------
Thanks a lot for any help here!
Public Declare Function OpenPrinter Lib "winspool.drv" Alias "OpenPrinterA"
(ByVal pPrinterName As String, ByRef phPrinter As IntPtr, ByRef pDefault As
WinSpool.PRINTER_DEFAULTS) As Integer
Public Declare Auto Function GetDefaultPrinter Lib "winspool.drv" (ByVal
pszBuffer As String, ByRef pcchBuffer As Integer) As Boolean
Public Declare Function SetPrinter Lib "winspool.drv" Alias "SetPrinterA"
(ByVal hPrinter As IntPtr, ByVal level As Integer, ByVal pPrinter As IntPtr,
ByVal cmd As Integer) As Integer
Public Declare Function GetPrinter Lib "winspool.drv" Alias "GetPrinterA"
(ByVal hPrinter As IntPtr, ByVal level As Integer, ByVal pPrinter As IntPtr,
ByVal cbBuf As Integer, ByRef pcbNeeded As Integer) As Integer
Public Declare Function DocumentProperties Lib "winspool.drv" Alias
"DocumentPropertiesA" (ByVal hwnd As IntPtr, ByVal hPrinter As IntPtr,
<MarshalAs(UnmanagedType.LPStr)> ByVal pDeviceName As String, ByVal
pDevModeOutput As IntPtr, ByVal pDevModeInput As IntPtr, ByVal fMode As
Integer) As Integer
Public Declare Auto Function ClosePrinter Lib "winspool.drv" (ByVal hPrinter
As IntPtr) As Integer
only the "A" version would work correctly. Anyone have a suggestion of why
the "W" version would not work correctly?
One reason is that the ByRef or ByVal does not show by InteliSence so the
"p" would help there.
------
Secondly, I'd like to be consistent with the parameter names. I'd like to
precede with a "p" if ByRef or if a pointer is expected, whichever make more
sense.
Which is better to use?
If a string is passed by value should the variable strat with a "p"?
What about an IntPrt variable?
It would be a good example if someone would fix the parameter names below.
----------
Thanks a lot for any help here!
Public Declare Function OpenPrinter Lib "winspool.drv" Alias "OpenPrinterA"
(ByVal pPrinterName As String, ByRef phPrinter As IntPtr, ByRef pDefault As
WinSpool.PRINTER_DEFAULTS) As Integer
Public Declare Auto Function GetDefaultPrinter Lib "winspool.drv" (ByVal
pszBuffer As String, ByRef pcchBuffer As Integer) As Boolean
Public Declare Function SetPrinter Lib "winspool.drv" Alias "SetPrinterA"
(ByVal hPrinter As IntPtr, ByVal level As Integer, ByVal pPrinter As IntPtr,
ByVal cmd As Integer) As Integer
Public Declare Function GetPrinter Lib "winspool.drv" Alias "GetPrinterA"
(ByVal hPrinter As IntPtr, ByVal level As Integer, ByVal pPrinter As IntPtr,
ByVal cbBuf As Integer, ByRef pcbNeeded As Integer) As Integer
Public Declare Function DocumentProperties Lib "winspool.drv" Alias
"DocumentPropertiesA" (ByVal hwnd As IntPtr, ByVal hPrinter As IntPtr,
<MarshalAs(UnmanagedType.LPStr)> ByVal pDeviceName As String, ByVal
pDevModeOutput As IntPtr, ByVal pDevModeInput As IntPtr, ByVal fMode As
Integer) As Integer
Public Declare Auto Function ClosePrinter Lib "winspool.drv" (ByVal hPrinter
As IntPtr) As Integer