473,395 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Printer Command

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.
Jun 30 '06 #1
5 4104
Take a look at these links:

http://msdn.microsoft.com/library/de...printtopic.asp

http://msdn2.microsoft.com/en-us/lib...ent.print.aspx

http://msdn.microsoft.com/library/de...ngprinting.asp
Sub-Lt wrote:
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.


Jun 30 '06 #2
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/de...ualbasic70.asp

Sub-Lt wrote:
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.


Jun 30 '06 #3
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
....

"Ahmed" wrote:
Take a look at these links:

http://msdn.microsoft.com/library/de...printtopic.asp

http://msdn2.microsoft.com/en-us/lib...ent.print.aspx

http://msdn.microsoft.com/library/de...ngprinting.asp
Sub-Lt wrote:
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.


Jun 30 '06 #4
Did you declare hPrinter as a intPtr?
Sub-Lt wrote:
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
...

"Ahmed" wrote:
Take a look at these links:

http://msdn.microsoft.com/library/de...printtopic.asp

http://msdn2.microsoft.com/en-us/lib...ent.print.aspx

http://msdn.microsoft.com/library/de...ngprinting.asp
Sub-Lt wrote:
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.



Jun 30 '06 #5
Dim hPrinter As IntPtr ' The printer handle.

I copied the code exactly as shown.

"Ahmed" wrote:
Did you declare hPrinter as a intPtr?
Sub-Lt wrote:
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
...

"Ahmed" wrote:
Take a look at these links:

http://msdn.microsoft.com/library/de...printtopic.asp

http://msdn2.microsoft.com/en-us/lib...ent.print.aspx

http://msdn.microsoft.com/library/de...ngprinting.asp
Sub-Lt wrote:
> 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.


Jun 30 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: RC | last post by:
I am using docmd.printout to send Reports (formatted as labels) to a barcode label printer. I need to collate the labels so that I print lable 1 twice, then label 2 twice, then label 3 twice, etc....
2
by: Eagle | last post by:
Is there any way to make a print button on a form show the printer properties dialog before actual printing the report linked to the command button in AC97 ? I've noticed that opening the report...
2
by: Ryan Gregg | last post by:
I'm working on a project where I need to be able to print a single line at a time to a dot matrix printer. Essentially we have a log printer and each time an event occurs on the system I need to...
6
by: Ioannis Demetriades | last post by:
Hi, I need to change the printer's font to "control" -a printer font, and then send a sequence of characters to the printer. My problem is that I cannot change the printer's font. Can this be...
27
by: tomhr | last post by:
I have a Borland Turbo C++ compiler (though I never use the "plus-plus" part), copyright 1990. I use this compiler to write simple programs, one of which I am quite dependent on. A month ago, my...
1
by: Sub-Lt | last post by:
Hello! 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...
0
by: neeraj | last post by:
Hi all I have developed on desktop application in Visual Basic for Hotel Management and my client requires multiple printing options here I have multiple printers first default printer which...
9
by: id10t error | last post by:
Hello, I am going to be using a Symbol WT4090 to scan items. I need to printer a tag from the Zebra ql320 plus. I am trying to do this is Visual basic 2005. Does anyone know and good site to...
0
by: dtnam | last post by:
Hi, I want to do something like that: void doc_PrintPage(object sender, PrintPageEventArgs e) { // draw a rectangle e.Graphics.DrawRectangle(Pens.Black, new Rectangle(10, 10, 100,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.