Printer problem with linefeeds at beginning, slightly solved

Hello,
at first I want to thank you answering my last problems.
I think it's a device driver problem or a windows problem (tried W2k, WinXP,
Editor, Wordpad, all the same). There seems to be bad data in the buffer
when each print job starts, also after cold booting the pc and printer - so
there's always bad data before printing.

My question: Is it possible to erase the contents of the printer buffer? I
think this could solve my problem. How can I erase the buffer?

Thanks for your help,
Guido


0
guidof73 (128)
12/14/2006 2:36:58 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
477 Views

Similar Articles

[PageSpeed] 40

Hello,

I have an ESC command of the printer to initialize it: ESC @
But I don't know how to send it to the printer, since I use MS Visual
C++.NET 2003 with TextOut(...,"Hello printer").
In the manual there is a description with BASIC commands:
10 LPRINT CHR$(27); "@";

How to be solved in C++?
Thanks,
Guido


0
guidof73 (128)
12/14/2006 4:18:59 PM
You have to use the "Escape" mechanism to send things directly to the printer.  I haven't
used this in many, many years.

Note that TextOut has very little to do with writing to the printer; that's just some
weird side effect that happens eventually.  At the simplest level, think of TextOut as
drawing to a bitmap that will be sent to the printer, not as something that is actually
writing text to the printer.  The Escape method, however, sends raw bytes to the output
stream.  

Most dot-matrix printers can't print anything that Windows can create, so what the print
spooler does is take a metafile and call on the printer driver to convert the metafile to
a bitmap at the time of transmission.  Some printer drivers just draw the bitmap directly
to the spooler file which then transmits the bitmap down.

In terms of how Escape works with your printer, you have to understand that TextOut does
NOT write text to your printer; it writes it indirectly, and some other independent,
asynchronous transport mechanism delivers it to your printer.  If you really want to write
raw text to your printer using the printer control codes, open device LPT: and do
WriteFile.

Similarly, examples done in DOS Basic on how to use the printer are somewhere between
irrelevant and misleading nearly all the time.  Your printer driver is supposed to deal
with these issues.  Now, if you were opening the raw printer as device LPT: and doing
WriteFile operations to it, then indeed you might need to send this initialize sequence.
But when printing with Windows, do you have any evidence that it is required?  If it
isn't, then ignore the problem.  If it is, then the driver is supposed to supply it.
That's assuming you have the right driver installed for your printer.

You can use the PASSTHROUGH option if the Escape feature is supported (there's another
option to query if the Escape feature is supported for your printer), otherwise you need
to think about what you are printing, how, and why.
					joe

On Thu, 14 Dec 2006 17:18:59 +0100, "Guido Franzke" <guidof73@yahoo.de> wrote:

>Hello,
>
>I have an ESC command of the printer to initialize it: ESC @
>But I don't know how to send it to the printer, since I use MS Visual
>C++.NET 2003 with TextOut(...,"Hello printer").
>In the manual there is a description with BASIC commands:
>10 LPRINT CHR$(27); "@";
>
>How to be solved in C++?
>Thanks,
>Guido
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
12/14/2006 7:49:42 PM
Reply:

Similar Artilces:

Mysterious email problem
I work for an ISP and I have a weird email problem that no one seems to be able to solve. I have about 10 email accounts with different domains that if they receive what I call the 'little email' (under 400k and no headers or display name) it hangs up all the mail behind it until I telnet into their account and delete it. I can't find a common denominatior between them. OE, Outlook 2... or 2003, Mac 9, Windows, they have updated windows and NAV. They are not all on the same mail server either. I have removed the account and added it back. The only thing I haven'...

RMS Purchasing problems
RMS SO 2.0 does not appear to be taking open transfer outs into consideration when generating a PO. Shouldn't any open transfer out be treated in the same maner as a committed amount? Tom, If you are finding RMS' Purchase Order tools not up to par, please check out our Advanced Purchase Order tool for RMS: http://www.rite.us/PlugInDirectory/AdvancedPurchaseOrder.aspx. If you have any questions, please shoot me an email or give me a call! Thank you, Ryan Sakry Program Manager rsakry@rite.us http://www.rite.us 320-230-2282 ext. 4002 (Office) 320-230-1796 (Fax) ...

Font size problem
I have a file tags.txt which is in Courier New 10.5 and I want to change it to 9. It will change and save OK, but when I re-open it has gone back to 10.5. Changing it in WordPad works, and if I re-open in WordPad it remembers it is 9, but it goes back to 10.5 when opened in Word. A Command Button in Access runs a VBA instruction to open the document in Word, and I cannot find any way to change the font size it opens in. Can anyone advise a way round the problem? Thanks Dudley If this is a plain text file, then it does not store the font formatting - only the text. The dis...

Outlook 2002 Problem :(
I am unable to open my inbox. The address line contains the following: http://www.jraun.com/search.php?search=outlook:Inbox This is the same for all of the folders. Anyone have any ideas. Nancy <anonymous@discussions.microsoft.com> wrote: > I am unable to open my inbox. The address line contains > the following: > http://www.jraun.com/search.php?search=outlook:Inbox > > This is the same for all of the folders. Spyware. Get Spybot Search and Destroy and Ad-Aware and run them (Google is your friend). For now, though, right-click on your Inbox, click Properties, then...

Citrix Printer Problem
When running on our Citrix server, everytime we change companies in Dynamics the printer changes from the user's default to another printer. Anyone know how to make Dynamics stay with the default printer? We are running Dynamics Ver 7.0 and Citrix Metaframe XP Ver 1.0 on a Windows Sever 2003. Thanks Hi How is the GP client installed on the Citrx server? Are all the users using the same DEX.ini file? "JEK" <JEK@discussions.microsoft.com> wrote in message news:0BB7F031-0E3C-4BF0-91AD-1160B34EC642@microsoft.com... > When running on our Citrix server, everytime...

Payables Cheque
When printing a payables cheque (Transactions > Purchasing > Print Cheques), after selecting Process, I am prompted to print to the screen, printer or a file. Is there a way to default this always to the printer & not even be prompted for it. Thanks Yes, in Posting Setup (Administration>Posting>Posting) select the Purchasing Series and Computer Checks Origin. In the bottom section of the window, you'll see each of the reports that print when you hit Process. You can de-select the ? to prevent the system from asking for the destination, de-select the Scre...

Print Preview Problem
I have posted an excel spreadsheet that colleagues access through Internet Explorer. When the spreadsheet is accessed the print preview command is no longer on the menu, BUT print preview is available in Excel and Internet Explorer normally. Help!! Thank you in advance for any advice! Stewart MOS Excel Expert (not expert enough!) Have you tried right clicking on the menu bar to see if print preview button became inactive for what ever reason? >-----Original Message----- >I have posted an excel spreadsheet that colleagues access >through Internet Explorer. When the spre...

excel vba
i have set it up so that when they click a command button i automatically saves the invoice sheet into my documents with the K cell contents as the file name. However, i would like to have it set u so that one they close, the next time they open the sheet to do anothe invoice it will be 1 number higher than the last saved invoice number The reply posted before took care of most of that, but now it seem that when i click the command button to auto save it to my docs an close the sheet, when i open a new sheet it comes up as the sam number. Should there be some sort of loop code in there? code:...

Problems exporting Vcard
I have been trying to export a Vcard from Outlook 2003 Everytime I try to open or export a Vcard, it gives me the error "A Required Component is missing: WAB32.DLL Please install Microsoft Outlook Again". I have totally removed office, and reinstalled it. Still get the same error. HELP! people send me Vcards all the time, and I used to use them; but i cannot anymore because of this. Can anyone shed any light on this. thanks Bob bobcooley@yahoo.com ...

Printer status?
Hi to everyone! I don't know if this argument is OffTopic. Anyway I would like to seriously discuss about Getting the status of a common windows printer. I think I've read most of the threads about this argument. Most of them suggest to view an example on an MSDN article ... something like Q160129 "How To Get the Status of a Printer and a Print Job"...or anyway suggest to use the PRINTER_INFO_n structures... Well, this DOES NOT WORK!. Probably I make some mistakes... but if is true that there are some structures like PRINTER_INFO_n, that have an entry for the status... is...

Domain users cannot print on networked printer in SBS 2003 R2 netw
Hi , I have an Epson CX11NF printer networked to a server running SBS 2003 R2. The printer has been added to the server and I can print from the server. When logged onto a network client as a domain admin I can print. When logged on as a domain user on a network client I cannot print (error printing). When logged on as a domain print operator on a network client I cannot print. Domain users have the correct permissions on the server Windows Temp and Spool folders. I have the same results whether the printer properties are set for spooled printing or direct to printer printing....

Column Heading problem
Hi, I didn't change any setting in my Excel but all the column identifiers have all changed to numbers. Column "A" changed to "1", Column "B" changed to "2"....and so on. Does anyone know why? How to change back to original setting? Thanks. Terence Tools>Options>General, uncheck R1C1 Reference style -- Regards, Niek Otten Microsoft MVP - Excel "Terence" <terence5070@hotmail.com> wrote in message news:01c801c35fd6$668b2160$a001280a@phx.gbl... > Hi, > > I didn't change any setting in my Excel but all the col...

default email account problem.
Is there a way in outlook2003 to NOT have a default email account when creating a new message? For example I want outlook to ask me every time which email account to use before sending the message instead of automatically sending it with the default email account. Yes I know that I can choose which account to use but the problems is sometimes I just forget and it creates problems and makes an idiot out of me when I email someone with a different account. Paul wrote: > Is there a way in outlook2003 to NOT have a default email account when > creating a new message? For example I wa...

problem inheriting from XmlDocument and XmlElement
hello there everyone.. I have created a class called "ProcessLog" inheriting from XmlDocument and two classes ("UploadedItem", "ProcessError") inheriting from XmlElement. I then have two classes ("UploadedTemplate", "UploadedPresentation") which inherit from "UploadedItem")... so far so good. I have overriden the CreateElement method of "ProccessLog" and it creates the correct elements as expected. The problem is I need to override SelectSingleNode and SelectNodes to return types "UploadedPresentation", &qu...

PDF Printer as default GP printer
I have my PDF printer set up as my default printer. When printing a SOP Invoice - it asks me where to create the file to....is there a way to setup a default file location for the creating of PDF's? Thanks Andrea, This issue cannot be done through GP since GP is only sending the printing job to the printer, you may need to look in the application settings that created this printer. For printers created by Adobe PDF follow steps below: 1. Right click the printer. 2. Go to Advanced Tab 3. Click on Printing Defaults. 4. Uncheck "Prompt for Adobe PDF filename" Regards, -- M...

Account register sorting problem
Hi. I searched this group via Google Groups and did not find an answer to my question. In Microsoft Money 2004 Small Business, I set my checking account register to "Sort by date" and "Sort Decreasing". That part works; however, the bottom (oldest) transaction is automatically selected. I hit Ctrl+Home to select the top transaction. That is fine as long as my Money session is ongoing. When I exit Money and return to the very same register, Money takes me to the bottom transaction again. It annoys me to have to Ctrl-Home in every account register each time I launch Mo...

Problem Entering Custom Fields in MS Project 2007 PLEASE HELP!!!
Hey everyone, I am working on a huge platform development project. We are dealing with a large amount of requests from various departments. I thought it would be useful to add a custom field named "Department" so that I could sort by this field and have a good view of what is needed by each department. I have gotten the field up and running so I can enter the text. The problem I am dealing with, is whatever I type in the custom text field I have added, is mirrored in the Priority field (in the main view, not the Gaant Chart view). Clearly this is a huge problem, because the pri...

Why is printer driver receiving JPG?
Hello, I'm working on a printer driver based on the Oemuni example from the DDK. The problem is that OEMBitBlt (and other functions) are receiving jpegs as the destination source (as identified by psoDest- >fjBitmap == BMF_JPEG). In my EnablePDEV, I'm setting the DEVINFO->flGraphicsCaps2 flag to 0 (even though it should already be 0). Am I understanding the documentation wrong or should psoDst not be in jpeg format? On Jan 19, 4:51=A0pm, Agromatic <sutton1...@gmail.com> wrote: > Hello, > > I'm working on a printer driver based on the Oemuni ex...

Problem with CRectTracker
Hi, I'm developing a control similar to Windows Explorer. To enable multiple selection of items using mouse drag, I'm using a CRectTracker to do the drawing of the selection rect and then changing the selection state of items accordingly. This works fine, but when the items are scrolled (Using ScrollWindow when the mouse reaches the borders of the client area), the CRectTracker erasing and drawing go out of sync causing stray selection rectangles to appear. The window control being used with CRectTracker is developed from scratch and not a Windows Common Control. Thanks....

Append Query Problem
Hello, I have a query that calculates a bank balance. I want this query to append the current days date and the bank balance to a table. I have a macro setup to autorun the query when my database opens, but can't get it to work correctly. Details: Table where I want the records added: BankingBalanceRecord Query that will run: BankingRecordBalance -This query is setup to pull today's date and the balance. It is funtioning properly. The main problem I am having is that if the primary record (Today's date) already exists, it gives me an er...

users should administer printers not administrators
Great Plains administration of printers (Unnecessary administration is required) Named Printers is obviously a flawed idea. The administrator of the GP program should not be involved with the user period…. The basic concept is that the administrator knows every printer in the company or multiple companies in my case, the users and where all things should print… That’s a phenomenal amount of memory required to do a simple job… As an administrator it’s best to stay out of the way of all the users needs, keep with the security issues and have as little to do with Let the user assign his ow...

Copy and Paste problem
Hi, I have made macros to copy sheet form one file and paste into another, however somtimes there is a problem when for example I change print area in target file or anything else I recive a message: Error the target area is not the same size as the copy area what is starnge as area doesnt change, only solution i found is simply delete the file and make a new one. Im sure you have same problem but did you find a solution ? Piotr, I'm not sure what the Print Area has to do with copying and pasting. Have you determined for sure which statement in your code is generating the error? ...

problem with GDI+
Hello, I've got a problem with GDI+. I want to draw some shapes in a view class CPlotView which is a child of CScrollView. In OnDraw section I use this code: void CPlotView::OnDraw(CDC* pDC) { CDocument* pDoc = GetDocument(); Gdiplus::Graphics g(pDC->m_hDC); Gdiplus::Pen pen(Gdiplus::Color(255, 0, 0, 255)); g.DrawLine(&pen,0,0,100,100); } But nothig appears in the window. If I use standard GDI, for example pDC->LineTo(10,10,100,100); everything works. Where do I do a mistake? Thank you in advance for help, Tomek The Gdiplus.dll must be copied to the system d...

CString and CRLF problem
Hi guys, I'm trying to make a little program that will take a text file and convert the whole thing to a single line. Here is what I am doing: CString string // fill the string with my text file string.Replace("\r\n","\n"); // to be safe in case it was Unix string.Replace("\n","\r\n"); // make them all Windows style string.Replace("\r\n",""); // get rid of the line breaks string.Replace("\t",""); // kill the tabs while I'm at it string+="\r\n"; // add a line break at the very end Well, I s...

Discount problem
Hi – We allow for 15% off any mix of 12 items or more from one department. The problem is that if we apply a 15% discount to the entire order, it would then discount items from other departments and sale items from that department as well, which are not normally discounted. I currently got around the problem by setting all the other departments and sale items to ‘non discountable'. The problem is, that, at times, I need to discount or adjust those other items as well. Is there any way to identify only those items that the discount would apply to, so I don't need to set every oth...