|
Pls dont send me any link i have gone through them ,
I have an MFC Application .
My problem is simple that i have a document from which
in need to print . but when i print the font size change
gets small which is also visisble in the printpriview .
is there any simple way by which i can have the same
printout as it is visible in the frame window
thanx
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
In your view's OnPrepareDC() method, play around with SetMapMode() , SetWindowOrg() , SetViewportOrg() , SetWindowExt() , and SetViewportExt() . I might have left a sample in the code for this article.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
How are you creating your font for printing?
You can use CreatPointFont(), passing in the printer DC which will account for the higher DPI of the printer as compared to the screen. Or you could use CreateFontIndirect() and calculating the LOGFONT.lfHeight variable depending on the DPI of the printer
logfont.lfHeight = -MulDiv(PointSize, PrinterDC.GetDeviceCaps(LOGPIXELSY), 72);
MyCFont.CreateFontIndirect(&logfont); I can't recall where I got the MulDiv formula from, but I am sure it is in MSDN somewhere.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I'm having the same problem.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
How can i progrmatically determine the existing drives/patitions?
|
|
|
|
|
With GetLogicalDrives(VOID) and associated APIs
~RaGE();
|
|
|
|
|
You can use FindFirstVolume(...) and its related functions to iterate over configured volumes (on systems that support volume management). Partitions are going to be a bit harder, because there could be Partition types on the system that Windows does not recognize (e.g. ext2 , ext3 ).
Getting just the configured drive letters only gets you the ones that are actually assigned to drive letters.
You may have to actually read a drive's partition table - CreateFile(...) to open a physical drive using \\.\PHYSICALDRIVE0 , \\.\PHYSICALDRIVE1 , etc., and DeviceIOControl(...) to access partition information. Look up the PARTITION_INFORMATION and PARTITION_INFORMATION_EX structures in an updated MSDN Library (or online) for more information.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
how can i add a hyperlink in dialog; i have tried following
in the text/caption property;
<A href = "http://codeproject.com">cp</A>
but it simply displays the above line and not the hyperlink.
thanks in advance
|
|
|
|
|
|
|
Hi
I'm using my own class witch derives from CListCtrl and I can't select rows, and I dynamicly creat it with ::Create(...); it's like the CListCtrl doesn't receive input at all. How how can I get to see selection?
I tried to create CListCtr at design time and it works all right.
|
|
|
|
|
I think This Example is your answer
This Example For CStatic Control But for your answer
CStatic --> CListCtrl
Function Onclick -> your Function
in the BEGIN_MESSAGE_MAP
you should use functions CListCtrl
//In cpp File
BEGIN_MESSAGE_MAP(CViewerView, CFormView)
ON_STN_CLICKED(ID_SCROLLSIZE, OnClick)
END_MESSAGE_MAP()
void CViewerView::OnInitial()
{
....
....
CRect Rect;
m_ScrollSize.Create("",SS_BLACKRECT|WS_CHILD|WS_VISIBLE|SS_NOTIFY,
Rect,this,ID_SCROLLSIZE);
}
in Header file////////////////////
#define ID_SCROLLSIZE 100;
class CAnswer : public CDialog
{
...
...
DECLARE_MESSAGE_MAP()
public:
CStatic m_ScrollSize;
afx_msg void OnClick();
};
|
|
|
|
|
|
in the onclick event of the button; use the shellexecute command, and in the command to be executed write
hh ur-html-help-filename
so when u will click button hh will open the html file.
hh.exe is the program which executes the compiled html help files.
|
|
|
|
|
Thank's
I will use the "What's this help" by using the html help functionas mentioned in the article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/vsconovhtmlhelpapioverview.asp[^]
what I did is:
I took the function:
void CMainFrame::HtmlHelp(DWORD_PTR dwData, UINT nCmd)
{
HWND hwnd = HtmlHelp( GetDesktopWindow),
"c:\\Help.chm::/Intro.htm>Mainwin",
HH_DISPLAY_TOPIC, NULL) ;
CGuiFrameWnd::HtmlHelp(dwData, nCmd);
}
when I debugged I could enter the CMainFrame::HtmlHelp function after pressing the What`s this arrow and clicking left at any frame or window.
Then I found the information to use the HWND hwnd = ... function as mentioned above. Now I get the error HtmlHelp function does not accept 4 parameters.
As in the article mentioned the .lib is included and the path for <htmlhelp.h> is set.
So I have no clue what to do!!
Thank`s soo much!
Georg
|
|
|
|
|
A group of warning messages are being displayed when the project is being built. Each of such message is being generated from every source file where this is being used.
Can any one help me out in supressing or deleting these warnings.
The warning is:
"warning C4995: 'CDaoTableDef': name was marked as #pragma deprecated"
Thanks,
---Arun.
|
|
|
|
|
place the following on top of the file:
#pragma warning( disable : 4995 )
|
|
|
|
|
if the name of the class is marked as deprecated, it is because you shouldn't use it anymore !
there is certainly another way to do what you try to achieve a bit differently...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
Yes, placing
#pragma warning( disable : 4995 )
the above sentence would probably do good. But in my situation where I have a number of such messages coming from different files in the same project. Can I place it once in a particular location and avoid all such messages, instead of placing it in every source file.
Thanks,
---Arun.
|
|
|
|
|
|
How Can I register a Crystal Report Viewer Comnponent in VC++? and from where I can get this component, is there any link to download? I did not find any component in my MFC.
|
|
|
|
|
Hello programmer's
I need to help
How to change MCI_DGV_SETVIDEO_BRIGHTNESS in the MCI_SETVIDEO
I Can't use this parameter it's not response to Value
Thanks for answer
|
|
|
|
|
VisuallC wrote: I Can't use this parameter...
Why not?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Thanks for answer But
I can't use
Can you post example from this statement
|
|
|
|
|
VisuallC wrote: I can't use
Why not?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|