Solved

OnPreparePrinting error

Posted on 1997-04-07
2
917 Views
Last Modified: 2013-11-20
I have an app. which uses the "OnPreparePrinting" class.
in this function I set my max page i.e
pInfo->SetMaxPage(2), and then call
BOOL bRet = DoPreparePrinting(pInfo);

At this point when I run my app. my print dialog comes up where I choose my printer type, number of pages.. and then click on OK.  Somewhere in the DoPreparePrinting, I get
an assertion failed error.

File: viewprnt.cpp line 211 which shows as follows:

VERIFY(pInfo->m_strPageDesc.LoadString(AFX_IDS_PREVIEWPAGEDESC));
I don't know how to get around this verify.  I am not sure what I have to set in my pInfo struct. to get around this error.

Can anyone help?
Thanking you in advance,

Sunjoy
0
Comment
Question by:parmar
2 Comments
 
LVL 1

Accepted Solution

by:
serge010697 earned 50 total points
ID: 1300907
Try to include AFXPRINT.RC file in your project.
It should be in MFC\INCLUDE subdirectory of your VC++ directory.
At least this is truth for VC++ 4.2.
0
 
LVL 4

Expert Comment

by:mbhakta
ID: 1300908
Tell us which/what version of VC++ are you using ??
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now