|
In the OnBeginPrinting function of my view class I am displaying a CFontDialog dialog box. I want the default font to be Arial and the default size to be 10. When the dialog box displays, it a shows default size of 62.
Here is the code. These are the first lines in the OnBeginPrinting function.
ASSERT(pDC->GetMapMode() == MM_TEXT);
LOGFONT lf;
::ZeroMemory(&lf, sizeof(LOGFONT));
lf.lfHeight = -MulDiv(10, pDC->GetDeviceCaps(LOGPIXELSY), 72);
lstrcpy(lf.lfFaceName, _T("Arial"));
CFontDialog dlg&lf, CF_PRINTERFONTS, pDC);
if (dlg.DoModal() == IDOK)
{
m_strFont = dlg.GetFaceName();
m_nPointSize = dlg.GetSize() / 10;
}
Why is the dialog displaying the wrong size value?
|
|
|
|
|
Lonnie Johnson wrote: Why is the dialog displaying the wrong size value?
I don't know, but have you tried using values other than 10 to see if a pattern exists?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Here are the results from some other point sizes.
input point size size that appears in the dialog box.
8 50
12 62
14 88
16 100
18 113
20 125
|
|
|
|
|
What is the value returned from GetDeviceCaps()? printers have way more pixels per inch than screens do. What is the value of lfHeight?
|
|
|
|
|
The value returned by pDC->GetDeviceCaps(LOGPIXELSY) is 600.
The computed value for lf.lfHeight when 8 points is used is -67.
The resulting size value in the Select Font dialog is 50.
|
|
|
|
|
|
How to open virtualdub source code with visual c++ 6?
(The source code hasn't dsp or dsw file)
|
|
|
|
|
If there's no project file for your compiler and no .mak file it can convert to a project then you'll just have to make one yourself. Examining the project files it does have, most are xml-ish these days, should give you the basic layout of the code. Make an empty project and start adding source files. It's not an easy job and getting the final few compiler setting right can be maddeningly difficult but it can be done. I did this for a friend with the xvid source a few years ago. It may take a few hours of fiddling around but unless it's an absolute monster project, like glibc or something, you'll get it.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Hello,
i need to split my dialog in two parts, horizontal but with resize option!
I mean like in windows explorer left part are the folders and right is the list control,
and i can resize this area with folders!
I need the same only in horizontal form, is something like this possible for dialog application??
thanks for any information/help!!
termal
|
|
|
|
|
You can do whatever you want with your dialog. Anyway possibly using two windows for the purpose will be simpler.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
Why u are trying a CSplitterWnd in CSingleDocTemplate. I think Splitter Window is best in this case.
thanks
Nitheesh.
Nitheesh George
http://www.thesimpletools.blogspot.com
|
|
|
|
|
Hi,
I am looking for some example code that could get me going with a client/server real time video application.
My application needs:
1. input usb video on the client (right now single usb webcam...eventually 2 cameras)
2. stream video to server where it is displayed in real time (occasional lost frames isn't a problem)
3. send about 25-30 bytes of additional data from client at least 10 times a second (occasional lost data isn't a problem) to also be displayed and/or processed by server
4. send a small amount of data from the server to the client as required, with reasonable certainty of it being received
Does anyone have any C++ example code (preferably full project files) that would get me started? I am using Developer Studio 6.0.
Regards,
Neil
|
|
|
|
|
Would you like us to bring you a cup of water as well?
|
|
|
|
|
Hello All,
I am developing an application for WM 5. This can also be used in WM6.
If the error reporting is enabled and if I invoke the application, gwes.exe error message is displayed. In WM6.1 it gives Application name with the error message.
Is this the problem with OS.?
When I googled, the solution for this is to disable the error reporting.
Can anyone tell me how to solve this using code.?
Regards,
Madyastha.
|
|
|
|
|
Did you try debugging your app? That might give you a clue on what is going on.
Did the error occur while running it on the emulator or on the device? If it is on the device, did it run without a trouble in the emulator?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Even in emulator also it is not working. As i have problem with WININET API i can't run it on emulator. But before having this class also it was giving the same problem.
My app consists of 3 project. I have run first version of the same application on emulator am getting this error "The MCli can not be opened. Either it is not signed with trusted certificate, or one of its components can not be found. You might need to reinstall or restore this file"
modified on Friday, September 26, 2008 9:37 AM
|
|
|
|
|
Hi All
I have a two class Class A and Class B.I have a public type function sun();in class A.And i want to call function sun() in class B. How can i call it?Plz help me.
Thanks in Advance
|
|
|
|
|
MsmVc wrote: How can i call it?
In the context of a class A object.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
class A
{
public:
void sun()
{
}
};
class B
{
public:
void B::callSun()
{
A a;
a.sun();
}
};
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks all it's working..
Your reply help me
|
|
|
|
|
Is there any way to pass some parameters to DialogBox function in win32 api
Actually I want to pass some values to it . I donot want to them global
INT_PTR DialogBox( HINSTANCE hInstance,
LPCTSTR lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc
);
Ashish
|
|
|
|
|
use DialogBoxParam()
Prasann
|
|
|
|
|
Hi all,
i am writing this code
char Label[256]="";
char FS[256]="";
DWORD SerialNumber=0, MaxFileLen=0, FileSysFlag=0;
if (GetVolumeInformation(str,Label,256,&SerialNumber,
&MaxFileLen,&FileSysFlag,
FS,256))
{
Temp.Format(_T("%X"), SerialNumber);
Temp=CString(_T("Serial Number: ")) + Temp.Left(4) +
CString(_T("-")) + Temp.Right(4) + CString(_T("\r\n"));
Result+=Temp;
}
buts its giving a error
error C2664: 'GetVolumeInformationW' : cannot convert parameter 2 from 'char [256]' to 'LPWSTR'
how can i remove this
thanks in advance
|
|
|
|
|
i think ur project settings use Unicode character set. so u have to use unicode strings (wide char like WCHAR)
prasann
|
|
|
|
|
thanks it solved my problem but i wanted to know one more thing i want label of my drive... which api i can use for doing so???
|
|
|
|