Printing through MFC

Hi All,
               I want to print a html file through MFC application.
How can i do this? I have bypass  print dialog window.  Thanks for
your inputs.

Regards,
Manohar

0
5/2/2007 6:21:28 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
530 Views

Similar Articles

[PageSpeed] 19

On 1 May 2007 23:21:28 -0700, Manu <manoharbasireddy@gmail.com> wrote:

Hi Manohar,


>               I want to print a html file through MFC application.
>How can i do this? I have bypass  print dialog window.  Thanks for
>your inputs.

you might consider using and embedded webbrowser control in your MFC
app.

You might Google for some code samples, e.g. on CodeProject.
I found the following url:

http://www.codeproject.com/com/webbrowser.asp?df=100&forumid=14873&exp=0&select=468965

MrAsm
0
mrasm (715)
5/2/2007 7:56:28 AM
Not sure about the HTML stuff, as I've not done any. I guess you use
an HTML View class and then call OnPrint().

Bypassing the print dialog is done like this:
BOOL CMyView::OnPreparePrinting(CPrintInfo* pInfo)
{
      if ( pInfo->m_bPreview )        // normal print preview
            return DoPreparePrinting(pInfo);

// actual printing
      pInfo->m_bPreview = TRUE;  // stops print dialog being thrown
(KB Q140538)
      BOOL bRetval = DoPreparePrinting( pInfo );
      pInfo->m_bPreview = FALSE;
      return bRetval;
}

Paul.

0
paul.ganney1 (118)
5/2/2007 8:55:07 AM
For my own part, I simply drop the
html file my app create on temp folder
on the disk, and send the file to open
to windows.  Windows simply start
IE with the file...

Then, the user has the choice to print
em on any printer attached to his computer,
or any printer accessible on his LAN.

Samething for Excel files my apps create!
IE and Excel manage printer and the user
normally know how to use them!

jmarc..


"Manu" <manoharbasireddy@gmail.com> wrote in message 
news:1178086888.851456.279030@h2g2000hsg.googlegroups.com...
> Hi All,
>               I want to print a html file through MFC application.
> How can i do this? I have bypass  print dialog window.  Thanks for
> your inputs.
>
> Regards,
> Manohar
> 


0
jmarc (108)
5/2/2007 2:01:18 PM
Reply:

Similar Artilces:

.prn print file
I created a .prn print file from my printer. When I open it in Excel 2000 it opens as garbage. A appreciate any help. John Hi John, My experience with .prn is limited to downloads from a GEAC database. I import them as text documents and play to discover what the delimiter is. Most times it is comma or | Good luck ray >-----Original Message----- >I created a .prn print file from my printer. When I open it in Excel 2000 >it opens as garbage. A appreciate any help. > >John > > >. > John *.prn files are just that. To be printed. They consist of printer co...

My prints are to small.What can i do to make them larger?
I can enlargen text on screen , but when i print it prints small.Can you offer some kind of help. Change the font size instead of your zoom percentage. -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "gopazz1" <gopazz1@discussions.microsoft.com> wrote in message news:2A2484AA-4C38-4B1A-B75E-C61022909992@microsoft.com... >I can enlargen text on screen , but when i print it prints small.Can you > offer some kind of help. > ...

Html emails not printing problem
Hi Outlook 2003 with Exchange 2003. My problem is that the Outlook 2003 does not print html emails. It prints plain text emails fine. In an html email if I click on printer icon, nothing happens. If I select File->Print menu the print dialog does not appear. I am using IE6. I have tried the following so far without luck; - Remove any additional software that I can think of in case it was interfering. - Scanned the pc using Trend's online HouseCall anti-virus/spyware program and removed some minor spyware. - Installed IE7 but at start-up it comes up with title 'Customise your...

Need help with printing Excel document
I want to print it out exactly as it looks on the screen. With all the cells and rows visable. Highlight all the cells you wish to see printed out. Then do File > PrintArea > SetPrintArea...........then do File > PrintPreview.......what you see is what will print out, assuming you have the correct print drivers and margins set etc......... If it still don't work, post back with more details. Vaya con Dios, Chuck, CABGx3 "jody mullis via OfficeKB.com" <forum@OfficeKB.com> wrote in message news:507040B8C48C0@OfficeKB.com... > I want to print it out exactly a...

How to spwan(in MFC)?
how to spwan??? Hello, WinExec() system() ShellExecute[Ex]() CreateProcess() Regards, Elias http://www.codeproject.com/system/newbiespawn.asp -- Regards, Nish [VC++ MVP] "�Ϲο�" <fuerza@kebi.com> wrote in message news:bh79mv$m1n$1@news1.kornet.net... > how to spwan??? > > ...

Printing without certain text (i.e., answers, notes)
Does anyone know an easy way to print two versions of a document? For example, I need to print a student version without answers and instructor's notes. Thanks, TM One way would be to use a style (call it Answers for example), when you want to print out the students copies change the color of the style Answers to white. That should do it. "TM" <t_mccollough@yahoo.com> wrote in message news:e6czHS2YDHA.1384@TK2MSFTNGP10.phx.gbl... > Does anyone know an easy way to print two versions of a document? For > example, I need to print a student version without answers an...

General Ledger - General Posting Journal
On the General Posting Journal Printed Report (print JE's), how do I add a column on the printed report to show the Distribution Reference (next to the account description)? Example: Journal Transaction Transaction Audit Trail Entry Type Reference Code 2,083 Standard Adj Aug Interest GLTRX0000318 Account Description **DISTRIBUTION REFERENCE** Debit Credit 000-1000-000 Interest Exp Book interest to actual xx xx ...

font printing problem of imported visio file inside power point file
I am having a problem with VISIO 2002 with PowerPoint 2000. I made a drawing with some fonts with VISIO 2002. Then I copied the drawing and pasted into PowerPoint file. In screen, I can clearly see the font. When I print the file, drawings are there but there are no font from printed paper. Would you please help me out regarding this problem? ...

Show gridlines only prints every other line
Every time I try to print a document in Excel 2003 and use the show gridlines feature, it only prints the lines every other line. It will print a line then skip one and then print a line and so on. Does anybody have an idea what is causing this, or how to fix it. Appreciate any assistance, Jason ...

Publisher 97 and date/time print
I am designing an office card using 1997 Publisher. No matter what I do it prints day, month,year and time on every page. I have checked background and there is no text box even there to delete to stop this problem. How can I find and delete? This will be an option of your printer driver. Disable that option and your trauma will be over. -- ...

Publisher 2003 printing missing
At my school my students are creating newsletters. On random lines...on each student's printout...there are partial lines printed. Some titles don't print. Students have tried changing the size of the font, the font itself, the size of the text boxes, etc. We are always missing partial lines. It is a different place on each paper and it happens on different printers. Any suggestions? Barbmc wrote: > At my school my students are creating newsletters. On random lines...on each > student's printout...there are partial lines printed. Some titles don't > p...

Printing only a disclaimer on the even pages of a report
I have a report that must have a disclaimer on the back of each page (no data just verbage). Can someone tell me how to set this up please. TIA for the help. Steve ...

printing on legal
Anyone have success printing legal size doc from a pcl5 driver using publisher 97...using a Gestetner 3225. other office apps print on legal ok My page setup says legal, the printer driver says legal, I'm even telling it what tray to go to that contains legal..... Publisher is more demanding on printer drivers than other applications. Is there a newer driver for your printer? http://www.nrgcss.com/drivers/Page2.asp -- Mary Sauer MS MVP http://office.microsoft.com/clipart/ http://www.mvps.org/msauer/getting_started.htm news://msnews.microsoft.com "Jaqueline Naghdi" <jn...

Header
I have a spreadsheet that prints out on 3 pages of A4. However, the header prints at the top of each page. How do I get it to print at the top of the first page, only, please? Gareth -- For essential news about Huddersfield Town Football Club join the Terriers Mailing List at www.Terriers.me.uk . Two separate print jobs are required. You can use a macro to speed it up but it is still two print jobs. See Ron de Bruin's site for code. Gord Dibben MS Excel MVP On Sun, 27 Jul 2008 02:46:28 +0100, "Gareth J Dykes" <firstname.lastname@btinternet.com> wrote: >I ...

getting rid of the standard mfc icon (in taskbar)
i made an application based on mfc, and used the standard mfc icon up until now. i thought changing it would be a simple task. in the resource editor i got rid of all mfc icons in various resolutions, and replaced it with my own icon in 3 different resolutions. it does work in almost all the places: the main window is shown with the correct icon, the taskbar shows correctly with the icon, even MessageBox() shows the icon now, but as soon as i do open a MessageBox while my main-window is shown, the counter in taskbar moves up to two (you know how windows xp groups together tasks with th...

Finding Desktop region in MFC
I am working on a commercial application, and recently discovered a bug I have been asked to fix (they threw it back in my lap). Run the application on a 2-monitor system, such as a laptop in a dock with an external monitor. Drag the main window to the second (non-taskbar) window and quit. Now move the laptop to a different dock with the second menu on the other side (or without a second monitor at all) and launch the app. Oops. The app continues to want to go on the side it was last put, even though there is now no monitor there. (Yes, my dock in the office and at home have the second ...

Print File
How do I use a FileSytemObject in VBA code to print a word document from excel. I'm not sure how you would. But I saved this from a previous post. Option Explicit Sub testme() 'Dim WDApp As Word.Application 'Dim WDDoc As Word.Document Dim WDApp As Object Dim WDDoc As Object Dim myDocName As String Dim WordWasRunning As Boolean Dim testStr As String myDocName = "C:\my documents\word\document1.doc" testStr = "" On Error Resume Next testStr = Dir(myDocName) On Error GoTo 0 If testStr = "&quo...

CAsyncSocket()::OnReceive() will not be fired !!! -> MFC BUG ?!?
Hello peoples i have wrotten a FTP-Client with a own Class of CAsyncSocket. Sometime the messagge from the Server will NOT BE reveiced, but the server have ben sendet to the Client ( the OnReceive() of the Client is not called !!) I use MSVS6.0 OR can´t use the CAsyncSocket for a FTP-Client ? ( the CInternetConnetion can´t use, why i need ALL sended and received data for displaying regard Nico van Halobar Nico van Halobard wrote: > Hello peoples, > > i have wrotten a FTP-Client with a own Class of CAsyncSocket. Sometime the messagge from the Server will NOT BE revei...

Printing Woes #2
I have a spreadsheet (my timesheet). For some reason, this spreadsheet defaults to 3 copies when it prints. I only need one. So, I manually go in, change the number of copies needed, hit print, save the spreadsheet. When I come back into the spreadsheet the next week, it is back to 3 copies. I have saved the original spreadsheet, did a save as and gave it a new name, etc, and I still can't get it to default back to one copy. Any ideas. TIA, Brenda ...

Printing Labels #5
Can you use a roll of labels with MS Office? Specifically, can you rip off 6 labels, which would be approximately half a piece of paper, and feed it through a printer, while using MS Publisher or MS Word? You probably can, it will take some effort to setup the page correctly. Merging would be questionable. In page setup, select custom, input the label width and length plus one label more for the margin. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "LACE" <LACE@discussions.microsoft.com> wrote in message news:52...

printing multiple newsletters
When printing an 11x17, folded newsletter and using mail merge in Publisher I encounter problems. There are 664 addresses in my merge list and I am required to press Enter 664 times to get all of them published. This happens on our old C2620. I agreed to upgrade the machine to a C5185i but with reservations as you can imagine. Still, we cannot mail merge our newsletter on the newest machine in Publisher. Ed Bennett's fix from KATMA does not seem to fix this problem. Any other suggestions? Thanks. Are you getting an error message? There are some problems with commercial CMYK merges ...

print attachement
Hello, I would like Outlook to check for a specific attachement in incoming email (for example all attached word documents in format "ras*.doc") and to print the attached document automatically. Is is possible using rules ? do I need a script ? any idea how to do it ? Thank you ...

print out
I have excel file with colour background and plain pattern. When I print a excel file, the print out is coming with doted pattern. and if i copy entire sheet and paste it some other excel file, I can get exact print out with plain background. But every time I can not copy and take print out. But I want to take with plain pattern in the same file. Any idea what is the problem in the file. Hi vishu, If I understand correctly you are copying the values and formulas, or are using Edit, Past Special, Values, but not the formatting. The safest way is to copy the entire sheet. Edit...

Printing out postcards...
I have Windows XP & Publisher 2003. I am selecting blank postcard design with multiple copies per sheet selected (2 across & 2 down). I would like to have each one with a different picture and text. When I do this in all quadrants, it places all 4 of those in each postcard section when printing. Is there a way to separate a page into 4 sections (like with the multiple copies per sheet option), but have a different picture with text in each quadrant? Any suggestions or work arounds? thanks Lay your publication out manually. In the page setup select landscape, in the arran...

No Print Dialogs
Suggestion - Add the following option to the User Preferences window so the following switch can be completed within the application and not require manually editing the Dex.ini file - NoPrintDialogs=TRUE or NoPrintDialogs=FALSE TechKnowledge Content Question How should the NoPrintDialogs setting be set up in the DEX.INI file? Answer You will need to add this setting to your DEX.INI file: NoPrintDialogs=TRUE and save your changes. A value of TRUE means that print dialog boxes will not appear; if you don't include this line, or use a setting of FALSE, print dialog boxes will a...