Print MFC Dialog

Hi,

I have a MFC dialog application. The main dialog has a number of controls on 
it including an ADO data grid and also a bitmap.

I would like to print the whole dialog out. 

I obviously cant use the CView printing options as it is a dialog application.

I'd appreciate any suggesstions as to how i can achieve this,

Thanks In Advance
Macca
0
macca (52)
5/13/2005 9:48:02 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
866 Views

Similar Articles

[PageSpeed] 18

I would suggest paying visit to codeguru forum and search articles and posts.
http://www.codeguru.com/forum/ and http://www.codeguru.com


"Macca" wrote:

> Hi,
> 
> I have a MFC dialog application. The main dialog has a number of controls on 
> it including an ADO data grid and also a bitmap.
> 
> I would like to print the whole dialog out. 
> 
> I obviously cant use the CView printing options as it is a dialog application.
> 
> I'd appreciate any suggesstions as to how i can achieve this,
> 
> Thanks In Advance
> Macca
0
RainMan6256 (150)
5/13/2005 4:02:03 PM
Check out the code in the following link:
http://code.axter.com/PrintWnd.h
http://code.axter.com/PrintWnd.cpp

Using the above code, you can print your dialog by using the following 
command:
PrintWnd(this);

"Macca" wrote:

> Hi,
> 
> I have a MFC dialog application. The main dialog has a number of controls on 
> it including an ADO data grid and also a bitmap.
> 
> I would like to print the whole dialog out. 
> 
> I obviously cant use the CView printing options as it is a dialog application.
> 
> I'd appreciate any suggesstions as to how i can achieve this,
> 
> Thanks In Advance
> Macca
0
axter (7)
5/13/2005 7:18:02 PM
Reply:

Similar Artilces:

Sequential ticket numbers and printing 4 to a page
Hi, i have mail merged my numbers from excel into my publisher ticket. Thanks that worked well, now i want to print 4 tickets to an A4 page and in print preview, i get 4 tickets all with the same number on one page. how do i get around this? Many thanks Print preview showing all the same is a bug. Print a test page. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com http://officebeta.iponet.net/en-us/publisher/FX100649111033.aspx "Neyol" <Neyol@discussions.microsoft.com> wrote in message news:90034D4C-9951-4550-9DAC...

Creating a print-macro that'll only print page 1?
Hi, I have a spreadsheet that contains multiple sheets. I want to add a button that runs a macro, which only prints page 1 on the first sheet (called Scorekort). The "Scorekort" sheet contains 13 pages in total, but I only want to print the first page. Any ideas for this macro? Anders hi, Sub Macro1() Sheets("Scorekort").PrintOut From:=1, To:=1, Copies:=1, Preview:=True, Collate:=True End Sub if you don't want a print preview, Preview:=False -- isabelle Le 2011-05-21 04:16, Anders M a �crit : > Hi, > > I have a spreadsheet that contains multiple ...

Telnet in MFC
Does anyone know of a good example of a telnet (or other text based protocol) client written in MFC? "Isaac Raway" <isaac@blueapples.org> wrote: >Does anyone know of a good example of a telnet (or other text based >protocol) client written in MFC? http://www.mctainsh.com/win32/telnet.aspx -- Tim Slattery MS MVP(DTS) Slattery_T@bls.gov On Fri, 11 Jul 2003 13:25:36 -0500, "Isaac Raway" <isaac@blueapples.org> wrote: >Does anyone know of a good example of a telnet (or other text based >protocol) client written in MFC? > For telnet and termin...

How do I print only odd pages in Publisher and then only even page
I am attempting duplex printing with a printer that is unable to do duplex printing by printing odd pages first and then flipping the pages over and printing only even pages. No option is given that I can find in the print window. Help! Sarah Wright wrote: > I am attempting duplex printing with a printer that is unable to do > duplex printing by printing odd pages first and then flipping the > pages over and printing only even pages. > > No option is given that I can find in the print window. > > Help! The duplex printing add-in can be found here (http://publisherm...

Converting a MFC DLL to a regular DLL
Hi, I have an MFC DLL which i have now removed the single MFC window that popped up error messages. I want to now convert it to a regular DLL. What parts of the code to i need to remove / modify? And what compiler settings need changing? On Aug 4, 6:05=A0am, hamishd <Hamish.D...@gmail.com> wrote: > Hi, I have an MFC DLL which i have now removed the single MFC window > that popped up error messages. > > I want to now convert it to a regular DLL. What parts of the code to i > need to remove / modify? And what compiler settings need changing? I would create a dummy MFC reg...

Printing drawings
Visio 2007 Professsional ... Have succesfully reverse engineered a SQL Server DB selecting tables. Select tables and PK, however drawing created has all columns included. Is there a way to suppress the columns so only the tables are revealed? Thanks, Jim Yes with Visio for enterprise architect version "Jim Peterson" <JimPeterson@discussions.microsoft.com> a écrit dans le message de news:1232D9FA-E60A-4BD1-AF91-A6EA688A1819@microsoft.com... > Visio 2007 Professsional ... > > Have succesfully reverse engineered a SQL Server DB selecting tables. > Select t...

Learning MFC
Hi Trying to learn MFC with VC++ 6.0 and I want to draw a simple game board. All I want is a 9 by 9 grid for the Suduko game. Each grid element should be able to hold a few characters. Would appreciate some ideas on how to create the grid using the dialogue creation parts of Visual Studio. Or, do I have to draw it at run time in which case, again, how do I do it? After drawing the grid will need to be able to do operations such as: ** write {text} to cell at {column} and {row} ** user has entered {digit} at {column} and {row} Have spent some time reading the MS VS help pages but I have not ...

Creating Dialog Pointer with new, causes Exception
Hello all, I've written an MFC app, which has a tabbed interface. When it starts up, it checks my registry key, to determine how many tabs it needs, it then creates each tab, and puts a custom non modal, child dialog on each tab. The problem is, in release mode, it can only create the first dialog, the second one causes a memory exception. It *looks* like MFC doesnt like me trying to initialize a pointer like so, when that pointer is NULL. m_pDialogs[i] = new CMyDialog; Thing is, isn't that the whole point of the new operator? And malloc for that matter? The only difference, th...

margin cut off when printed
a 4-up postcard looks perfect when viewed. When printed the top, rt side and bottom are cut off a bit. What can I do? First of all, give the Publisher version and Windows version you are using. The printer type also helps. Margins are set by your printer...ink jet printers can't print all the way to the edge of the paper. You need to find out your limitations and set up your document within those limitations. Draw a line from top to bottom and another from side to side, all the way across the page. Print the page, and then see where the lines stop. Melissa "Stan the man" &l...

Are there MFC subclasses that give a different "look and feel" to the UI?
I was wondering if there are free implementations of MFC subclasses of windows and controls that give you a different look and feel? I like the Windows 2000 look, but it's quite a bit dated now, and the XP look is hideous for my taste, so I'm looking for something new, more modern looking, sleek. Thanks in advance for any suggestions. Franco See if this has something your looking for. http://www.prof-uis.com/ "Franco" <cuminato@yahoo.com> wrote in message news:1149800640.987272.304540@c74g2000cwc.googlegroups.com... >I was wondering if there are free implementa...

Identified problem printing graphics #2
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Well Can anyone explain this latest miserable problem with MS Word 2008? When I print a large document to my HP 6MP printer, the document prints fine BUT ONLY WHEN I PRINT THE WHOLE DOCUMENT. The instant I print only a range of pages, it matters not if I start from the front or not, the graphics in the document do NOT print - even if they were generated by Word. Frankly I am sick with Microsoft's foisting off problematic software on us -- I only wish there were a real alternative choice! The real problem is that ...

IEnumUnknown->Next method causes a crash in MFC 7.1 (VS .net 2003)
Hi, I have a couple of ActiveX controls inserted in my MFC (MFC 7.1) dialog along with 2 buttons. I used "EnumObjects" method on the ole container to enumerate the Embedded ole objects. I could get to the IUnknown pointers of the ole objects that i inserted in the dialog. But after returning IUnknown pointers for the activex controls (i inserted), the IEnumUnknown->Next method still tries return some uninitialized object and eventually causes a crash. I used the following piece of code to enumerate the objects in the ole container. hr = pOleObj->GetClientSite( &pCl...

Print BCC fiend from Outlook 2007
Any way to Print BCC in Outlook 2007... Tks Screen capture. zzMHUME wrote: > Any way to Print BCC in Outlook 2007... > > Tks > > Other then Screen Capture... I see in Outlook 2003 you can do something in "Design Form Field" but does not have the same stuff in Outlook 2007... tks "Bob I" <birelan@yahoo.com> wrote in message news:%234ilCgceKHA.5608@TK2MSFTNGP05.phx.gbl... > Screen capture. > > zzMHUME wrote: > >> Any way to Print BCC in Outlook 2007... >> >> Tks >> >>...

Mixing ATL/MFC in VS2005 (reposting as crosspost)
Does anyone know of some sample code created using VS2005 that implements an out-of-proc COM server mixing MFC and ATL. I tried creating one from scratch but the wizard no longer allows MFC support in an ATL .EXE. Thanks, Drew On Jun 11, 5:52 pm, "Drew" <d...@dam.dam> wrote: > Does anyone know of some sample code created using VS2005 > that implements an out-of-proc COM server mixing MFC and ATL. > I tried creating one from scratch but the wizard no longer allows > MFC support in an ATL .EXE. > > Thanks, > Drew Following link is for VC6. I dont know...

Delete CDO page heading and following matter when printing an email document; to print the document only
I have used a modified form of Ron de Bruin's macro for sending Excel generated email via CDO. I would like to be able to print the CDO generated document without printing the heading (To: From: Subject: etc.) or any tags that may follow. Does anyone have a suggestion? Thanks. Michael If Worksheets("DataBase").Range("R348").Value = 1 And Worksheets("Record").Range("C21").Value > 0 Then Dim iMsg As Object Dim iConf As Object Dim ws As Worksheet Dim Sourcewb As Workbook Dim Flds As ...

Print Preview: possible to remove the Internet Explorer little icon from the dialog title bar?
Hello, Anybody knows if it is at all possible to get rid of the Internet Explorer icon that shows up in the title bar of the Print Preview Dialog? I am using CHtmlView and calling the Print Preview through IDispatch. I am also providing my customized template for the Print Preview GUI. Everything is perfect other than I'd like to know if that icon can be removed and or changed with my own icon. Would it have anything to do with favicon by chance? Thanks! weboludo ...

VC++ 6, MFC, Manifests and XP Styles
Hello every body, after reading this two laughable articles.... http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwxp/html/xptheming.asp http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwxp/html/xptheming.asp .... I decided to try it. I am using Windows XP Service pack 4, VC++ 6.0, I then created with AppWizard a standard SDI Application named TestXP, in the InitInstance I call InitCommonControls(). I link (Project/Settings/Link/Project Options) with ComCtl32.lib. I compile. I add to the Debug folder (where my TestXP.exe file is) the following manifest(Test...

Print preview question
When use preview the CR , how can I know the user press' print' button ? or press' export' button ? thanks "Sze" <abc@abc.com> wrote in message news:eGiRTfYgKHA.2188@TK2MSFTNGP04.phx.gbl... > When use preview the CR , how can I know the user press' print' button ? > or press' export' button ? > > thanks > > CR? Which print preview dialog are you using in what type of project? Hello Sze, Could you please let us know the Application context and elaborate the problem? By the way, we have migr...

Creating print sections within a worksheet
I'd like to have unique headers for parts of a worksheet when I print the data. Is it possible to create sections within a worksheet? Otherwise, if I have each set of unique data in separate tabs, eahc tab having it's unique header text, is there a way to create a pdf that is the combination of several tabs? My fallback would be to copy pieces of the data from Excel and paste them into sections of a Word document. Thanks, Jeff Jeff - See "Custom View" in Excel's Help. - Mike Middleton http://www.DecisionToolworks.com Decision Analysis Add-ins for Excel "M...

Drop Shadows Not Printing Correctly
For the past several years I have been using Photoshop to creat graphics with drop shadows. I recently tried to use them with Publsiher 2003 and instead of the shadow gently fading to white, there is a shadow with a vivid stopping point in Publsher when I print. On the screen it looks OK. I must have somenting set wrong as all my other programs print it correctly. (Open Office Writer, Photoshop, Adobe InDesign CS - I have not tried MS Word.) I have used different file formats, but still nothing prints correctly. Any help you can give me would be appreciated. funzero <funzer...

Quick Print button printing to last used printer and not default
Quick Print button indicates that it should be using the default printer, and does, unless you choose another printer to use. I can clear this by rebooting Word, however, is there any way in which I can force quick print to always and only use default printer? Thanks. Perhaps you can use a macro to accomplish what you are describing (ask in a programming newsgroup such as microsoft.public.word.vba.general). However, it would be relatively easy to press Ctrl+P and then pick the printer that you want in the dialog box. -- Stefan Blom Microsoft Word MVP "Jazz&q...

Print a .txt file
Hi, How can I programmatically print a specific text file ? (without using CPrintDialog) Yoav. Hi Yoavo, > How can I programmatically print a specific text file ? (without using > CPrintDialog) If you really just want to print a txt file you can use ShellExecute with "print" as verb: ShellExecute(yourHwndOrNULL, _T("print"), yourTextFilePath, NULL, NULL, SW_SHOWNORMAL); You find details here: http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx If that does not fit your needs, please describe what you want to do and what is missing in ShellExecute ...

Report only prints the first 48 characters of an 80 character text
I have an 80 character field (Description) which is only showing 48 characters even though there is room to print the whole description. Somehow, the formatting is causing it to limit the field size to 48 and to replace the remaining characters with "..." to every record that is over 48 characters. There appears to be plenty of room on the report for the whole field. I have tried changing the font size, moving the field to a separate line and stretching it across the page, but without success. This was originally written in Access 2003, but Access 2007 doesn't fix the ...

Images missing in all Word files, no print preview etc
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I am running into an issue with Word 2008 after recently upgrading from 2004. (BTW it is way faster now that it is a Universal Binary) <br><br>When I open old DOC files with images in them the images are always gone. I don't have a ton so I can't say if the image formats are all the same, they are basic GIF or BMP style graphics from what I remember. I can't see them in print layout mode, print preview, and they are missing when I print. I have checked to make sure it is not using the imag...

Receipt printing question
Is there any way to print 2 receipt for particular items. I have many items that we sell that have manufacture rebates and would like a second receipt to print for these particular items only. ...