No it does not work. ON this link it is written that it applies to VS2002
and VS2003
In VS2005 I am getting the message
PInvokeStackImbalance was detected
Message: A call to PInvoke function
'WindowsApplication2!WindowsApplication2.RawPrinterHelper::OpenPrinter'
has
unbalanced the stack. This is likely because the managed PInvoke
signature
does not match the unmanaged target signature. Check that the calling
convention and parameters of the PInvoke signature match the target
unmanaged signature
IN the line
If OpenPrinter(szPrinterName, hPrinter, 0) Then"rowe_newsgroups"
It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
Yes, it should work just fine.
AFAIK the .Net 2.0 framework only added more features, it didn't take
any away. (though some were deprecated - but the replacement is
usually mentioned in the warning.)
Seth Rowe
It applies only to VS2003. Is it possible to make it work on VS2005?
Thank you
messagenews:
[email protected]...
Is it possible in VB.NET to print document using dot matrix
printer
as we do with clipper? With Clipper we can set the column and
line
printing and also we can eject the printer through the code.
HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
<URL:
http://support.microsoft.com/?scid=kb;EN-US;322090>
[...]
Wagner, thx for your information. But, if we try to use windows
application, is it possible to print to a pre-printed form as we do
with clipper? How?
Did you take a look at the document I referenced above?
Try changing the DllImport from this:
<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 Long) As Boolean
End Function
To this:
<DllImport("winspool.Drv", EntryPoint:="OpenPrinterW", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)>
_
Private Shared Function OpenPrinter(ByVal pPrinterName As String,
_
ByRef hPrinter As IntPtr, ByVal pd As Integer) As Boolean
End Function
Let me know if it worked.
Thanks,
Seth Rowe