issues in print preview

Hi...

i have an application using CTreeview and CDocument based classes. This 
application is not doc/view and does not use any Doc templates as such. I'm 
instantiating the CTreeview based class manually and connecting it to the 
CDocument based class. Everything works fine except for a few things in Print 
Preview. When i press the Next Page button, the Previous page button doesnt 
get enabled and When i Zoom-in, Zoom-out is not enabled.

I'm sure this is a message routing problem because the same code works in a 
doc/view based app.

Need an insight into the problem.

Regards,
Gowhar.
0
gowharjan (2)
4/1/2005 5:35:02 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
208 Views

Similar Articles

[PageSpeed] 15


gowharjan wrote:

> Hi...
> 
> i have an application using CTreeview and CDocument based classes. This 
> application is not doc/view and does not use any Doc templates as such. I'm 
> instantiating the CTreeview based class manually and connecting it to the 
> CDocument based class. Everything works fine except for a few things in Print 
> Preview. When i press the Next Page button, the Previous page button doesnt 
> get enabled and When i Zoom-in, Zoom-out is not enabled.
> 
> I'm sure this is a message routing problem because the same code works in a 
> doc/view based app.

It should have nothing to do with the doc as the print loop doesn't know 
anything about the doc. (So there is your clue.)

The only good reason for not seeing 'Previous page' button I can think 
of is the minPage is messed up. If you implement the print loop 
according to garp, it should always work. (I haven't seen it fail and I 
have pounded on it.)

> Gowhar.

Best, Dan.

0
public21 (290)
4/1/2005 9:04:39 AM
Thanks for the reply.

"Dan Bloomquist" wrote:
> If you implement the print loop according to garp, it should always work. (I haven't >seen it fail and I  have pounded on it.) 
> Best, Dan.

I didnt understand what you mean by "implement the print loop according to 
garp" here. Hope you clarify.

My guess here is that MFC print preview is meant to be used inside apps 
based on Doc/View architecture and mine isnt one. I would first check with 
minPage though.

Regards,
Gowhar.
0
gowharjan (2)
4/1/2005 10:37:05 AM

gowharjan wrote:

> Thanks for the reply.
> 
> "Dan Bloomquist" wrote:
> 
>>If you implement the print loop according to garp, it should always work. (I haven't >seen it fail and I  have pounded on it.) 
>>Best, Dan.
> 
> I didnt understand what you mean by "implement the print loop according to 
> garp" here. Hope you clarify.

I guess that's just an American expression, sorry. I mean the microsoft 
rules:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_printing.3a_.multipage_documents.asp>

> 
> My guess here is that MFC print preview is meant to be used inside apps 
> based on Doc/View architecture and mine isnt one. I would first check with 
> minPage though.

No, the print loop and print preview are only related to CView. The doc 
has nothing to do with it. In its simplest terms:

BOOL CPrinterView::OnPreparePrinting(CPrintInfo* pInfo)
{
    // default preparation
    pInfo->SetMinPage( 1 );
    pInfo->SetMaxPage( 2 );
    return DoPreparePrinting( pInfo );
}

void CPrinterView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
    switch( pInfo->m_nCurPage )
    {
       case 1:
          //print page one stuff
          break;
       case 2:
          //print page two stuff
          break;
    }
}

And print preview will take care of itself. Stick a TRACE in OnPrint to 
watch nMinPage and nMaxPage. That's my first guess as to your problem.

> Gowhar.

Best, Dan.

0
public21 (290)
4/1/2005 6:06:24 PM
Reply:

Similar Artilces:

Format issues
I have created a template in word which I call through a VB script from excel. The excel data is populated in the word every time I run this script. Everything works fine and the data get populated. I have a header in the template which is represents one of the fields in the excel sheet. The header shows the correct linked value for the first 10 pages but then on shows the variable name instead of the value. I have no idea why it does that? can someone help The code is as follows: For iCurrentRow = 1 To iLastRow If ActiveSheet.Range("B" & iCurrentRow...

Outlook issues after Exchange migration
We recently migrated Exchange 5.5 mailboxes to Exchange 2003 on a new domain. This was performed with the exmerge utility in a 2 step process. Now there are 2 issues with Oulook: 1) When a user types a recipient name into the address field, the name autocompletes as normal. But when the mail is sent, a message returns saying it is undeliverable. However, if the user goes into the Contacts folder and from there selects the same user to send a message to, it is successful. 2) If a user shares a calendar, specifying the user with whom to share and the level of permissions, all users in ...

Taskbar issue
Hello All I'm hoping someone can help me with this long-standing problem with both XP and Vista on separate laptops and every computer I've had (except I think Win98). I'm thinking there may be no solution, but what it's worth a try. With both of my machines, I have the taskbar (as well as other toolbars) set out to maximum size - typically half the screen - and to auto hide. (This makes a great program and file launcher) The issue is that the operating system decides it wants open the taskbar on its own from time to time on its own. Various things prompt this, ma...

DST issue
I entered the catalog item: <Feature Name="Item" CatalogItemId="Item:MS:sysgen_timesvc_dst" /> and confirmed that the device has the registry key: HKLM\Software\Microsoft\Clock\AutoDST = 1 But the device still does not automatically adjust for DST. I set the timezone to Pacific, set the time to 3/14/2010 at 1:59AM, waited for one minute...and the time changed to 2:00AM instead of 3:00AM. What am I missing? Thanks. which OS version are you using? have you updated it with the relevant qfes which deal with the changing in DST starting day? -...

publisher flyer printing
I created a flyer in publisher in the "envelope DL" format. Because it's small, I'd like to print it 3 times on a sheet of paper. It won't let me select that option and prints it only once across the page. Hi - Since it is only 3, I would copy the entire (grouped) thing and paste it 3 times onto another file you have opened with a blank standard size page. (Watch out for your printer limitations on area it actually prints!) M. "Miriam" wrote: > I created a flyer in publisher in the "envelope DL" format. Because it's > small, I'd...

Outlook/EX Email Issue
I'm running Windows XP with XP Professional. I cannot send email but I can recieve it using Outlook. There error says that Outlook was unable to access the SMTP server. I cannot access my email at HOME through the web email. What I can do is send/recieve email using Outlook Express AND I can access my email through my web email client outside my home. My ISP (SBC) says its not them and I'm somewhat inclined to agree with them? They say I could have a corrupted kernel32.dll file. I have turned off my Norton, deleted my account and set up a new one and re-installed XP professiona...

Help! Printing Shared Calendar Crashes Outlook
Outlook 2003, latest patches running on XP Pro SP2 latest patches in a SBS / Exchange 2003 environment (all patched to the max). When any delegate to particular user's shared calendar attempts to print the calendar, Outlook crashes: white window, Outlook.exe using 100% of CPU. Eventually Outlook comes back and prints many pages of rubbish. Not printer-specific, not workstation specific. Is there something wrong with that user's mailbox? How can I fix, please? Cheers, Bill A possible cause is if the delegate is trying to print the Daily Style which includes task items. Try...

Extender Install Issues
GP 8.0 Extender install - I'm encountering the following: *Login to GP brings up screen: "Great Plains Extender needs to finish installing. This may take a few minutes". It has an OK button and clicking on this gets you into GP but it comes up everytime. How can we stop this from popping up all the time. *When creating a new Extender Window and I get select the Form, I get the following error: "A remove range operation on table 'PT_User_Defined_Window_Keys' failed accessing SQL data." Procedure or function zDP_EXT40101L_1 has too many arguments spec...

Possible Report Issue
Hi. I'm working on a database for a safety audit. The auditors would like to be able to use some of the tables and subtables as a sort of checklist for the audits. The table/subtable structure is as follows: Topic -->Subtopic -->ProgramArea -->ProgramRequirement I decided to create a report that will output that data. However, the report is only outputting information if there are ProgramRequirements already entered for a given ProgramArea. Is there a way to get it to output the ProgramArea and ProgramRequirement even if blank? Or am I going about th...

Adobe issues
We are running GP 9.0, using Windows 7, just installed Adobe 8.0 and are unable to send documents to PDF from GP - the PDF option remains grayed out. We have folowed the KB articles that are available, no success. Do we need to install Adobe 9.0 due to running Windows 7? Is GP 9.0 compatible with Adobe 9? Thank you for any assistance.. Hi Susan, I have a client using Adobe 9 on Windows 7. However, they are on GP 10.0 It is working succesfully. -- Geoff James "Susan" wrote: > We are running GP 9.0, using Windows 7, just installed Adobe 8.0 and are ...

Issue with formula is Pivot table
I have the following formula in a pivot table: =IF(ISBLANK(Qtr[-1]),IF(ISNUMBER(Qtr[-2]),(Qtr[-2]*-0.08)+Qtr[-2], "),IF(ISBLANK(Qtr[-2]),0,Qtr[-1])) First to the issues that I am experiencing. First, the formula wa originally added as the one below but then updated to the formula abov to correctly reflect what I was trying to accomplish. =IF(ISBLANK(Qtr[-1]),IF(Qtr[-2]<>0,(Qtr[-2]*-0.08)+Qtr[-2], "),IF(ISBLANK(Qtr[-2]),0,Qtr[-1])) This issue is the original formula appears in the very first cell o the pivot table and then periodically through out the column. So, yo see ...

Print a 2-sided document in Excel for a 3-ring binder?
How do I print a 2-sided document in Excel for a 3-ring binder? I have tried everything I can think of, but the margins on the backside are identical to the margins on the front and that doesn't work. The right margin on the back needs to be like the left margin on the front in order to punch holes in the document. Any help you can give would be great! I cannot be the only one who needs to know how to do this. Thank you! You would normally set that option on the printer functions, File>Print>click Properties next to printer name. "Mayableu" wrote: &...

Outlook Web Access OWA Issue - Login Prompt for Images
Dear Outlook 2003 / Exchange 2003 Users, Starting over the last two weeks (possibly after an update on the Exchange server), all of my users are starting to encounter the same issue when using Outlook Web Access (using IE6 on XP Pro systems). We have images in our signature block, and now when someone replies using Webmail to an e-mail originally sent via Outlook 2003, a login prompt appears for each image in the e-mail. Every time you cancel the login box, a red x image box appears, until all of the images that should be there are represented by the red x boxes. For the record, this has w...

Hyperlink Issue #2
I have an issue with hyperlinks. When you click on the hyperlink on a webpage it returns an error stating that the the "item could not be created". Outlook 2000/Windows 2000 ...

Sheet moves at print time, loos fine at preview
When I preview the spread sheet the vertical relationship between the spreadsheet and the header looks fine, no space, but after I print it there is extra space between the header and the spreadsheet. What causes this? What am doing wrong? Thanks, Erich Check your left margin to see if all the row numbers are sequential. You may have accidentally decreased the row height on row 2 and yo can't see the space in print preview, but it's there when you print. If that's the case, select the whole row, right click and select Ro Height to adjust the height -- DataCollecto ---------...

Update Issues
Has anyone experienced any problems with XP Pro updates sent in Feb.? My Lenovo T61p has performed flawlessly for 2+years but suddenly started turning off and now stays on but freezes-up. I can’t detect a virus and seems like the Feb. updates are all that has changed. I plan to uninstall them….between freeze-ups, unless someone has a better thought. Thanks >Has anyone experienced any problems with XP Pro updates sent in Feb.? My >Lenovo T61p has performed flawlessly for 2+years but suddenly started turning >off and now stays on but freezes-up. I can�t detect a ...

~ issue
I am currently using Outlook Express 6 and have noticed that for the second time (did a format the first time thinking I had a virus!) that when I have downloaded the 330994 April 2003, Security update for Outlook Express 6 SP1 that anytime I make a change to my address book and reboot I get an icon on my desktop that is named "~" and it basically is my entire address book. Has anyone else experienced this problem and how do I remedy it? Thank you for any help! Sue In reviewing the Outlook Express newsgroups, this is reported as a known issue w/ no fix from Microsoft (report...

Multiple Outlook Mailboxes issues with 3.0
I have a large number of users who have more than one outlook mailboxes, When I open an email from one of the addtional mailboxes, I get an error message that tells me "Only Items in the default Outlook store can be promoted to Microsoft CRM." Does anyone know if this can be worked around?? ...

chkdsk issue
Whenever I run chkdsk /r, it finds quite a few errors and corrects them. An example is a lot of orphaned files. Then, if I run it again right away, it does the same thing and finds the sa,e orphaned files. What causes this and how can I correct it? Thank you. On 14 May 2010, five256@NOwhere.com wrote in microsoft.public.windows.vista.general: > Whenever I run chkdsk /r, it finds quite a few errors and corrects > them. An example is a lot of orphaned files. Then, if I run it > again right away, it does the same thing and finds the sa,e > orphaned files. What causes...

RSS Sync issue
Hi, I discovered that Outlook is not syncing all my RSS-Feeds. When i tried to export into an OPML list, the same issue which are not synced are not exported as well. Anyone idea ? Thanks Hans ...

How can I do a mail merge for printing label from an excel spread
I printed the directions from excel to go to mail merge in word and it seems to me that something lacks in the instructions. danish firemen, see if this will help, For help on Word mail merge using Excel as the data source have a look here http://www.mvps.org/dmcritchie/excel/mailmerg.htm http://www.mvps.org/word/FAQs/MailMerge/CreateAMailMerge.htm http://www.mvps.org/word/FAQs/MailMerge/CreateADataSource.htm A training tutorial for creating envelopes and labels. http://office.microsoft.com/training/training.aspx?AssetID=RC010390291033 -- Paul B Always backup your data before trying ...

Domain name issue migrating 5.5 to Exchange 2003
We are prepairing to migrate Echange 5.5 to Exchange 2003. This has come up as an issue: Our domain is cornerstone instead of cornerstone.com Our email address is "firstname.lastname@cornerstonegrp.com" instead of: "firstname.lastname@cornerstone.com" ...

Public Folder Replication issue #3
I have a single domain which is linked across a VPN to two sites. At both sites I have a DC and an Exchange box. The issue I am having is on Server A, I can see and access all public folders, on Server B I cannot see one folder and two other folders have no data. I have checked to ensure they are set up for replication and even in ESM it shows they are "In Sync" or "Local Modified". Any suggestions on how to resolve this would be greatly appreciated. Douglas Hiser In each public folder's properties do you have both servers showing as having replicas? Do yo...

Laptop Client Issues
I've got 2 issues with Laptop client: 1. When I open outlook, crm add-in works fine. I close outlook and reopen and I get the cannot load crm functinality error. I open again and it works. If I am in a state where there is an error, I can go to the add-in manager and uncheck crm addin, hit ok, the recheck crm addin and it will connect. This happens when I am online or offline. 2. Outlook hangs synching with exchange server. Sometimes the send/receive finishes and then seems to just hang. If I turn off crm addin, it always works correctly. Anyone else experiencing these iss...

Outlook Express Issue
Greetings I have inadvertently deleted a folder. The associated DBX file still exists. Any ideas as to how I might get it to reappear in my folders list in Outlook Express? TIA Maurice You can use import for this. For additional support ask in an Outlook Express forum. This is an Microsoft Office Outlook forum. Outlook Express is family of Internet Explorer and Outlook of the Office family. Here is the link for the right forum http://communities.microsoft.com/newsgroups/default.asp?icp=InternetExplorer Good Luck! -- Robert Sparnaaij [MVP-Outlook] www.howto-outlook.com Tips of th...