|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Printer CommandHello. 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. Take a look at these links:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdrawingprintingprintdocumentclassprinttopic.asp http://msdn2.microsoft.com/en-us/library/system.drawing.printing.printdocument.print.aspx http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdrawingprinting.asp Sub-Lt wrote: Show quoteHide quote > 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. 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 .... Show quoteHide quote "Ahmed" wrote: > Take a look at these links: > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdrawingprintingprintdocumentclassprinttopic.asp > > http://msdn2.microsoft.com/en-us/library/system.drawing.printing.printdocument.print.aspx > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdrawingprinting.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. > > Did you declare hPrinter as a intPtr?
Sub-Lt wrote: Show quoteHide quote > 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/default.asp?url=/library/en-us/cpref/html/frlrfsystemdrawingprintingprintdocumentclassprinttopic.asp > > > > http://msdn2.microsoft.com/en-us/library/system.drawing.printing.printdocument.print.aspx > > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdrawingprinting.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. > > > > Dim hPrinter As IntPtr ' The printer handle.
I copied the code exactly as shown. Show quoteHide quote "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/default.asp?url=/library/en-us/cpref/html/frlrfsystemdrawingprintingprintdocumentclassprinttopic.asp > > > > > > http://msdn2.microsoft.com/en-us/library/system.drawing.printing.printdocument.print.aspx > > > > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdrawingprinting.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. > > > > > > > > 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/default.asp?url=/library/en-us/vbcon/html/vbconprintingchangesinvisualbasic70.asp Sub-Lt wrote: Show quoteHide quote > 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.
String and int Issue
Visual Basic 6.0, Enterprise Edition ASP.NET: VSNET2003 to VSNET2005 Global.asax.vb in Visual Studio .NET 2005 Question on XMLSerialization Comparing recordsets in VB2005 What type is best for the return value of a function? DateTime problem DirectX and False Stretching Images Writing ActiveX DLL in VB 2005 |
|||||||||||||||||||||||