|
DWORD dwFlags = PD_PAGENUMS;
CWnd *pParent = this;
CPrintDialog printdlg(false, dwFlags,pParent);
if(printdlg.DoModal() == IDCANCEL)
return;
DEVMODE *MyPrintMode;
MyPrintMode = NULL;
MyPrintMode = printdlg.GetDevMode();
dc.Attach(printdlg.GetPrinterDC());
|
|
|
|
|
Why you dont use from PrintDlg(&pd); and use from pd.hDC
|
|
|
|
|
Please Sir, I don't understand you.
I learn My self , show me what to do.
Perhaps I don't know well what I am doing.
|
|
|
|
|
Would you like to correct my codes that I show you?
|
|
|
|
|
I said you can use from PrintDlg(&pd); like this
PRINTDLG pd;
DOCINFO di;
memset((void *)&pd, 0,sizeof(PRINTDLG));
pd.lStructSize = sizeof(PRINTDLG);
pd.hwndOwner = m_hWnd;
pd.Flags =PD_RETURNDC|PD_ENABLESETUPTEMPLATE;
pd.hInstance = NULL;
pd.nMaxPage=1;
pd.nMinPage=1;
pd.nCopies=1;
pd.hDevMode=0;
pd.nFromPage=1;
pd.nToPage=1;
PrintDlg(&pd);
di.cbSize = sizeof(DOCINFO);
di.lpszDocName = "Test";
di.lpszOutput = NULL;
StartDoc(pd.hDC, &di);
CImage m_Image;
m_Image.Load("c:\\0.bmp");
m_Image.BitBlt(pd.hDC,0,0,800,600,0,0,SRCCOPY);
EndDoc(pd.hDC);
|
|
|
|
|
No thing changed, Pages is dimmed again and initialise to 1 to 1.
I like that pages not dimmed and I can choose my self from what page to what pages to print like we do on Word or Excel
|
|
|
|
|
I didnt see this problem and you can print these pages or not
|
|
|
|
|
Pages to print is not fixed in the program codes.
I need when Printing dialog appears, i choice my self from 3 to 5 for example. Hence In the dialog that appears there is not this possibility to change because it's dimmed.
That's my problem
|
|
|
|
|
if you test my previous example you can see that i choose
pd.nFromPage=1; pd.nToPage=1; and it work do you test this code
|
|
|
|
|
I test it, I see that on printing dialog there is : pages from 1 to 1. And pages is dimmed. No means to change, that's my problem. Why is it dimmed, so there is no mean to change(for example from 1 to 2)
|
|
|
|
|
In this example if you change statement to
<br />
pd22.nMaxPage=10; <br />
pd22.nFromPage=1; <br />
pd22.nToPage=2; <br /> i think that your problem is solve
|
|
|
|
|
OK, now I obtain what I need.
Thanks for your help
|
|
|
|
|
Hi,
I am using ComboBox in my dialog.In proerty of the ComboBox i selected Type:DropList,OwnerDraw:No and i checked visible,Tabstop,sort,vertical scroll.
But when i click dropdown scroll in ComboBoc it shows only one data at a time,and the scrolls are very small and its very difficult to scroll down the list.What can i do to prevent this?
I think Normally it shows around 4 0r 5 datas when we click the dropdown scroll in that box and the vertical scrolls are easy to scroll.
But i can not get like this..Pls tell me
|
|
|
|
|
Please put another Combo box on u r dialog box, at the placing time drag the mouse down. And feel the differents of that combo.
|
|
|
|
|
Ya, i did like that,just i click dropdown and drag the size with mouse.Its working now
Anu
|
|
|
|
|
You need to set the height of combobox drop down, I think.
In the resource editor, pull up your dialog box, then click on the down arrow of the combox box (you will see it visibly change) and use your mouse to resize it vertically.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Is your problem is Height from ComboBox?
|
|
|
|
|
While the answer has already been provided, you might want to consider this class. It is a dynamically self-adjusting combobox.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I want to fill the background of my dialog box with a JPEG image. I also want to perform some actions , when I click some buttons I created in that image.
How can I make it ?
Thanks in advance....
vinsankar
|
|
|
|
|
|
if you want to fill bacground with image you can use from a brush and attach a picture to brush in WM_CTLCOLOR
-------------
if you want to draw a image dialog use form BitBlt or StretchBlt in WM_PAINT or WM_ERASEBKGND
|
|
|
|
|
WhiteSky wrote: if you want to draw a image dialog use form BitBlt or StretchBlt in WM_PAINT or WM_ERASEBKGND
he might be needing convertor thats return HBITMAP or CBitmap for the JPEG image!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hello Mr Alok Gupta,
if he wants to use jpg files he can uses CImage class for read and use CImage::BitBlt(...)
|
|
|
|
|
WhiteSky wrote: if he wants to use jpg files he can uses CImage class for read and use CImage::BitBlt(...)
right you go! ... you can use Alok too.. Hamid!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi all,
I am getting E_NOINTERFACE on calling IHTMLWindow4::get_frameElement.
Here is the simplified code -
CComPtr<IHTMLElement> apElement; <br />
CComPtr<IHTMLDocument2> apElementDoc;<br />
CComPtr<IHTMLWindow2> apElementWindow;<br />
CComQIPtr<IHTMLWindow4> apElementWindow4;<br />
CComPtr<IHTMLFrameBase> apFrameBase2;<br />
<br />
<br />
apElement->get_document(&apElementDoc);<br />
apElementDoc->get_parentWindow(&apElementWindow);<br />
apElementWindow4 = apElementWindow;<br />
apElementWindow4->get_frameElement(&apFrameBase2);
I am recieving IHTMLElement object in my event sink (which I have set up to listen to DIID_HTMLDocumentEvents2).
The HTML element in question is part of an iFrame.
But still get_frameElement returns me E_NOINTERFACE.
Am I doing something wrong here?
Thanks in advance
|
|
|
|