|
I support the above.
Величие не Бога может быть недооценена.
|
|
|
|
|
please give me an example ?
|
|
|
|
|
It could be something like this :
void CYourView::OnInitialUpdate()
{
CBaseOfYourView::OnInitialUpdate();
m_cFont.CreatePointFont(120, _T("Arial"));
...
}
void CYourView::OnDraw(CDC* pDC)
{
CSize cMaxCharSize(GetMaxCharSize(pDC, &m_cFont));
CRect cMaxCharRect(CPoint(100, 100), cMaxCharSize);
pDC->FillSolidRect(cMaxCharRect, RGB(0, 128, 200));
...
}
virtual void BeHappy() = 0;
|
|
|
|
|
|
http://msdn.microsoft.com/en-us/library/xwf9s90b(VS.71).aspx[^]
In Western European fonts, the widest character is usually capital letter M (that's why typesetters refer to em-height and em-width). Most fonts will contain a character call em_space, which is a space that is exactly as wide as the widest character in the font.
|
|
|
|
|
Please compare them :
- W
- M
virtual void BeHappy() = 0;
|
|
|
|
|
|
|
Hi All
How can i encrypt CString values?
|
|
|
|
|
Here you go[^]
There are algorithms and the encryption levels related to each one that you might use.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Thank for vital and important information...
|
|
|
|
|
|
dont call that encrypted
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hello, I am currently working on an MFC project. The project have a treeview and listview similar to the layout of windows registry editor. I was just wondering if any of you guys know how to change the focus wherein if the user click one item in the treeview and then presses the tab key the focus would be changed to the corresponding item in the listview? Please help.
|
|
|
|
|
Try it :
BOOL CLeft(Right)View::PreTranslateMessage(MSG* pMsg)
{
if (WM_KEYDOWN == pMsg->message) {
if (VK_TAB == pMsg->wParam) {
CWnd* pcWnd = YourFunctionToGetRight(Left)View();
if (pcWnd) {
pcWnd->SetFocus();
}
return TRUE;
}
}
return CBaseOfLeft(Right)View::PreTranslateMessage(MSG* pMsg);
}
virtual void BeHappy() = 0;
|
|
|
|
|
I have tried the code above but it slows down the application to the point it no longer populates the treeview, is there any other alternative?
|
|
|
|
|
Of course,
try to implement the reactions on WM_KEYDOWN for the both views
virtual void BeHappy() = 0;
|
|
|
|
|
thanks a lot, it works now.
|
|
|
|
|
Hi,
I have a dos console process communicating with a MFC Win32 program/process
I created a Cevent object passed the synchronization object to Dos console process created Process Table entry (DuplicateHandle)
on the MFC WIN32 end I have a Cdiloag residing in a Cwinthread UI flavor
My question is can the WIndow sdk api call SetEvent (to signal the shared Kernel object event) genarate a message to
the MFC Cdialog thread
thankx
|
|
|
|
|
If i understand your question, you should be able to intercept the event and generate the message yourself.
|
|
|
|
|
I am using the handle operator to get the syncronazation
handle
what is the MSG # WM_USER+ ???
|
|
|
|
|
Thankx the "C" SetEvent can'nt genarate
a WM_USER type message I understand
|
|
|
|
|
yes it should work. You use the HANDLE value of it not the object!!!
You can also use ::PostMessage(HWND,MSG,0,0) API. It works fine because it fits best in the Windows-GUI.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
As i understood, you have two applications
1. Console Application
2. MFC GUI Application( GUI thread derived )
Now you create a CEvent object in console application and duplicate the handle of the event object in MFC GUI.
So that means, you are looking to get the event change in both process, isn't it?
Now you have a doubt that if you call a SetEvent from Console application then whether it will generate a message to MFC thread.
As far as i understood, if u have the same concern then
It is yes, it will signal the wait inside the GUI application. But remember one thing this event is send to all the applications which have the same named event.
Величие не Бога может быть недооценена.
|
|
|
|
|
It was unamed I used DuplicateHandle to create an Entry in console process table
I think the best I can do is signal the event
and then send a message or post to the Cwintnhread UI/CDialog object
thankx
|
|
|
|