|
Thanx for all ur responses. Its working now !!!
I tried first to post a user defined message from the sheet's InitDialog. But that did not work as expected. Then i tried the same from the InitDialog of the property page. And it worked just as required.
Thanx again.
|
|
|
|
|
I have a 4-page document to print out. The first 3-pages are
printed in landscape. This I can do.
The last page needs to be printed in portrait. After the first
3-pages are printed, how can I change the orientation to portrait
without prompting the user to print again and this time select
portrait.
I use this code to switch to landscape:
BOOL CFormOptions::SetLandscape(CPrintInfo* pInfo)
{
tagPDA pPrintDlg;
AfxGetApp()->GetPrinterDeviceDefaults (&pPrintDlg);
pInfo->m_pPD->m_pd.hDevMode = pPrintDlg.hDevMode;
LPDEVMODE devMode = pInfo->m_pPD->GetDevMode();
if (devMode)
{
// devMode->dmPaperSize = DMPAPER_LEGAL;
devMode->dmPaperSize = DMPAPER_LETTER;
devMode->dmOrientation = DMORIENT_LANDSCAPE;
GlobalUnlock(devMode);
}
return DoPreparePrinting(pInfo);
}
and I call a similar function with DMORIENT_PORTRAIT just before
I print the 4th page, but it still prints in LANDSCAPE. Any idea
on how to change the orientation during the print process for just
that last page?
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
From where are you calling this function? Based on the fact that you are returning DoPreparePrinting() I will say you are calling it from OnPreparePrinting() . According to this MSDN page[^] you should be setting the page orientation in OnPrepareDC .
In OnPrepareDC you would update your DEVMODE structure as you have done, then call CDC::ResetDC with the updated DEVMODE to change the orientation.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
The secret is that you need to call pDC->ResetDC(&sNewDevModeStruct) after you call pDC->EndPage() for page 3 and prior to calling pDC->StartPage() for page 4.
ResetDC is the magic behind print jobs that have pages that are 1) different orientations 2) sourced from different paper bins 3) different paper sizes.
See MSDN for more info.
onwards and upwards...
|
|
|
|
|
is it possible to have a 256 color bitmaps in c++ resource?
includeh10
|
|
|
|
|
|
Use the import functionality to add them into the resource.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
|
I am using visual C++ .net
I want to try out a simple program by adding a close button on a dialog
what should I type on the
void TryDlg::OnBnClickedButton1()
{
}
Thanks
|
|
|
|
|
Take a look at EndDialog.
Or calling OnOk() or OnCancel() works also but DoModal will return IDOK or IDCANCEL then.
|
|
|
|
|
Thanks
OnCancel works well for the program
|
|
|
|
|
|
|
hiho@ll
i'm using Visual Studio .NET 2003 and a Setup Project for my Application
For my application i set a link in the program menu to my application
but it just opens the Folder of my programm and not the program directly!?
I was using the Target option in the Link Options of my Setup project
and i Can only set "Application Directory" as the target
how can i set the Target to Application Directory\myprog.exe?
thx @ll
|
|
|
|
|
maybe u can use inno setup instead.
i had ur problem before.
inno setup is very good except it can not replace files which is in using properly - maybe i lost some features of the setup, u can try it.
u can find downlod link in this forum or by google.
includeh10
|
|
|
|
|
hiho
thx for ur reply
but i made it already
i just clicked in the window for the client file system the "Add Link" Option and choosed the "primary output for myapp"
so the target changed to "primary output for myapp"
excuse for my bad english, i'm not using the english Version of Visual Studio
|
|
|
|
|
I am trying to find a way to extract and send the contents of TEXT FILE 1, via email, to a list of email addresses in TEXT FILE 2.
So just to clarify, I would like some code which will rip the contents of Text File 1 and send the contents to everyone in Text File 2.
Any help received will be greatly appreciated.
Thanks,
|
|
|
|
|
Where do you want help, In taking the contents of text files or sending the email?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
|
if SPAM, first fine is $4,000, second is $1.2 million.
amount of fine varies with countries by the law.
this replay is for in case that you don't know.
hope u can ignore the info.
cheers
includeh10
|
|
|
|
|
No, sorry to dissapoint you, but its not going to be used for SPAM!!
I am trying to implement a notification process in my comapany, which aims to notify users when a change has occured to certain documents and systems.
I have got a program that is triggered off when a change has been recorded. Now, I would like to find a process to notifiy users about the changes made.
Cheers.
|
|
|
|
|
|
Simple MAPI[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
i'm developing a bounds checker... and want to accept exxe files as input can anyone tell me about exe file formats... any links or ref books? -V.G
|
|
|
|
|
You'll want to study up on the PE file format. See here and here.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|