Printer Command

G

Guest

Hello. Cor Ligthert [MVP] In: microsoft.public.dotnet.general recommended
I ask this question here:


We are upgrading one of our apps from VB6 to VS2005(VB).

Barcode printing is part of the app. What we used to do is send the
printer
command directly to the printer. Printer.print {long printer command}
would
work. Since that doesn't exist anymore, how do we go about sending this
printer command to the barcode printer? The drawstring meathod prints the
command as an actual string on the barcode. I think it sees it as a
graphic
only, not an actual string.

Any insight would be appreciated! Thanks.
 
A

Ahmed

I missed this one:


"Printers Collection Changes
In Visual Basic 6.0, the Printers collection was used to direct the
output of a Printer object to a different printer. The Printers
collection contained a list of available printers that matched the list
displayed in the Windows Print dialog box.

In Visual Basic .NET, the Printers collection is replaced by the
PrintDialog control, which provides a standard Windows Print dialog
box.
For details, see Printers Collection Changes in Visual Basic .NET
"

http://msdn.microsoft.com/library/d.../html/vbconprintingchangesinvisualbasic70.asp
 
G

Guest

Thank you for the quick reply.
Actually, I found my solution at
http://support.microsoft.com/?scid=kb;EN-US;322090

The only problem here is that I am gettin the error :

A call to PInvoke function 'GEMS!GEMS.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.

at

if OpenPrinter(szPrinterName, hPrinter, 0) then
....
 
A

Ahmed

Did you declare hPrinter as a intPtr?


Sub-Lt said:
Thank you for the quick reply.
Actually, I found my solution at
http://support.microsoft.com/?scid=kb;EN-US;322090

The only problem here is that I am gettin the error :

A call to PInvoke function 'GEMS!GEMS.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.

at

if OpenPrinter(szPrinterName, hPrinter, 0) then
...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top