|
Use SetFont() , which is a method of the base CWnd class. See the documentation of CFont before using this function.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
By using SetFont():
BOOL CMyDlg::OnInitDialog()<br />
{<br />
CDialog::OnInitDialog();<br />
<br />
m_font.CreateStockObject(SYSTEM_FIXED_FONT);<br />
m_edit1.SetFont(&m_font);<br />
<br />
return TRUE;<br />
}
|
|
|
|
|
create a font, and set the edit control to use it. The font object should be a member var in your dlg class.
Method 1:
---------
OnInitDialog()
{
...
m_oFont.CreatePointFont(80,"MS Sans serif");
m_oEditControl.SetFont(&m_oFont);
...
}
Method 2:
---------
static LOGFONT BASED_CODE sEditFont =
{ -10, 0, 0, 0, FW_BOLD, 0, 0, 0, 0, OUT_STRING_PRECIS, CLIP_STROKE_PRECIS,
DEFAULT_QUALITY, VARIABLE_PITCH|FF_SWISS, "Arial"};
OnInitDialog()
{
...
m_oFont.CreateFontIndirect(&sEditFont);
m_oEditControl.SetFont(&m_oFont);
...
}
|
|
|
|
|
|
There are a bunch of utilities here (like grids) that I would like to try out from VB.NET. Microsoft says that they have made it pretty easy but I have not seen any examples of how to do it. Anyone with experience at this?
|
|
|
|
|
Hello,
I want to create a shortcut from code and I have no idea how .... can anyone give me a hint ?
tnanks !
|
|
|
|
|
I think the IShellLink interface is what you are after.
|
|
|
|
|
|
Hi, I am required to create two activeX applications, one of them will be pre-install on the computer an the factory and the other will be used by service and support when the user logs in the site, the activeX will gather information from the system in order for S&S to keep track of the users who log in to the site.
It is also requested not to use the default pop-up window from IE but our own pop-up window to provide the information about the activeX.
Well the problem is I am an student and I have no clue about activeX, so if someone could share some tutorials or skeleton code, it would be great.
"Learn from the mistakes of others.
You can't live long enough to make them all yourself.
Age doesn't always bring wisdom. Sometimes age comes alone".
"Failure doesn't mean I'm a failure, It does mean I have not yet succeeded;
Failure doesn't mean that I should give up, It does mean that I should try harder;
Failure doesn't mean that I will never make it, It does mean that I need more practice".
Thank you for helping.
|
|
|
|
|
Dear all,
I am using the following function to display the members of a memberlist.
I need also to display the books of a booklist. If I use the comments then there is no compilation problem, but I cant display the books, on the other hand if I do not use the comments there is a compilation problem because get_member() function does not accept class Member* argument, but only class Book* argument. How can I generalise the function to accept both arguments, and display both books and members using the same function?
template<class object="">
void List<object>::displayElement(char* type)
{
if (num_elements == 0)
cout<<"No "<<type<<" is="" found="" in="" the="" "<<type<<="" "array.\n";
="" else
="" for(int="" element="0;" element<this-="">num_elements; element++)
{
cout<<'\n';
//this->element_list[element]->display(association_list.get_member(element_list[element]));
}
}
Regards,
grscot
|
|
|
|
|
Fix your template parameter to make it more understandable. I must see "template."
Kuphryn
|
|
|
|
|
hi,
my application displays some animations using GDI.When i run the application at a quick speed over and over,the area outside my application window redraws.(can see flicker in ms word or even in vc toolbar).any guesses what the problem is??i'm not using GetDesktopWindow anywhere in my appln.
thanx
|
|
|
|
|
but hey.i'm using NONCLIENTMETRICS and SPI_GETNONCLIENTMETRICS for some fonts.will this cause any problem?
|
|
|
|
|
doubtful. How about SetRedraw or LockWindowUpdate?
Joel Lucsy
|
|
|
|
|
I've just added 8 new strings to my string table, with the ID's of these strings being set to 61440 - 61447, now when I run the app and use File | Open or File | Save the CFileDialog dialog comes up (default MFC MDI implementation) but the dialogs title is set to my new string resource. 61440 end's up in the open dialog and 61441 ends up in the save dialog.
What's going on? Is there a limit to the amount of resources I can have, or is there some significance to these resource ID's?
Dylan
|
|
|
|
|
Dylan Kenneally wrote:
but the dialogs title is set to my new string resource.
So what are you expecting to happen?
Dylan Kenneally wrote:
...is there some significance to these resource ID's?Depending on where the insertion point was when you inserted a new String Table item, the ID will be in a different range. I've never used IDs past the 32000 range.
|
|
|
|
|
hi,
I am working on an application to control the printers. I m getting a problem when i use SetDefaultPrinter in VC it gives me error of undeclared identifier i have included the header files. other function related to printers like OpenPrinter, GetPrinter etc r working fine but this one is not working can anybody help me out plzzz its urgent
take care
contact me at Jaffer_mumtaz@yahoo.com
|
|
|
|
|
It's a new functions only available on NT machines. In order for the compiler to see the function, you have to define WINVER to 0x500.
Joel Lucsy
|
|
|
|
|
Hi Joel
Thnx for replying early.
I m working on windows 2000 plzz can u guide me a little more on it.I desperately need the function to work on my machine. what i need to do in the code inorder to use that code.
take care
|
|
|
|
|
You have to include < winspool.h > in the cpp-file where you use it, you have to link against winspool.lib, and you have to read MSDN! Its all in there!
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
put the line:
#define WINVER 0x0500
in you stdafx.h before any #include's
Joel Lucsy
|
|
|
|
|
Hi joel
I still get the same error undeclared identifier. as far as linking the the winspool.lib file plzz explain it a little more wht i have done is in the project settings of VC i have linked the winspool.lib file.
take care
One thing more when i chaged the version it gave the error
then after some time it started working but with the same error. i m using win 2000 professional edition.
any help will be appreciated alot
|
|
|
|
|
You probably need to get the latest PlatformSDK from Microsoft.
Joel Lucsy
|
|
|
|
|
Hi!
Has anyone a working source code for Bluetooth under Windows XP using the included Microsoft Bluetooth stack? I need to get it working for my thesis, since this is the last unsolved problem. Can anyone help?
Thanks!!!
|
|
|
|
|
Nowadays the GUIs created with Flash MX are well received.
I love the visual effects that are not easy to achieve
just with some knowledge of Windows API and MFC.
I am some conversant with Windows API and MFC, so want to
go on using them to implement many parts of programs, while
creating GUI with Flash.
How to interact with Flash "controls" from within MFC? To be more specific,
if I press a button in the Flash I like to make a MFC dialog
box such as AfxMessageBox("Hello") pop up. Likewise, if I am to put
a string in an edit box in the Flash?
I haven't set about learning Flash yet but hope
some advice posted here could guide me through a new
programming experience.
|
|
|
|