|
try catch this message in PreTranslateMesssage method of your window class...
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor@soukhov.com | ICQ:57404554 | http://soukhov.com
|
|
|
|
|
Hi,
I have an application that makes use of a splitter window.
One pane makes use of several (up to sometimes 20) CView deriven windows.
Each of this views has a lot of child CWnd deriven windows and each such a window also has child controls like CCombo, CEdit
CLisBox etc.
Now I have a serious performance problem I think. My theory is that al the windows are 'eating' performance
by means of their message queues, is this possible? And if so, is it possible to stop these queues for the
above described views that are not active? Or is there a solution to decrease CPU use?
Hope someone can help me with this.
Regards,
Frank.
|
|
|
|
|
A message queue belongs to a thread, not a window, so you could have 15000 windows but they'd share the same queue.
My guess is that any slowdown would be due to MFC having to walk the message maps of all the views whenever a message is sent to your app.
--Mike--
http://home.inreach.com/mdunn/
Sometimes, arming yourself with a big pointy stake just won't do you any good.
|
|
|
|
|
Ok..I think I understand my problem now. I have a lot of CWnd deriven windows in each view which all have their own message map, each of these windows also have child windows which also have their own message map. Some numbers:
10 view classes, with each 10 windows and each of this window 20 sub windows -> say more than 220 windows that have their own message map. Could this cause my program to be very slow? And is there by any means a way to speed up the proces, work around the message map, or let MFC know not to walk through the message maps of certain windows (say all windows in the views that are not active?)
|
|
|
|
|
Hi Friends,
- I need to know following things
a) how to capture html text displayed in the Netscape Browser.
b) how to capture the events like Key down, Key Up events in the Netscape Browser
In any one of these programming languages C ,C++ or VC++, Java.
Thanks,
Prashanth
Prashanth BA
|
|
|
|
|
Hi all,
I want to know how can i change pointer with giving the number for pointing ???
I mean, when i give 2 to function it must point to record two ...
I have algorothm for myself:
m_rs->Move(lLink - m_rs->GetAbsolutePosition() - 1);
lLink is variable that i get of user for pointing ...
Do you have any good idea ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I do you verify that a folder exists with MFC?
Thanks
|
|
|
|
|
Try:
if (GetFileAttributes("My filename") & FILE_ATTRIBUTE_DIRECTORY)
{
// The directory exists
}
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Are the coloured scroll bars (on the codeproject website if you have IE5.5+) able to be achieved in C++ apps? i.e., is there a new version of the common controls with an extended FlatSB api or what???
Would be so perfect for some stuff we're doing here.
Nb
|
|
|
|
|
Hi all,
Is there an API function to send emails? We need to send email from an NT service... haven't come across anything so far.
thanks
n
|
|
|
|
|
How do you want to do it? MAPI, sockets, something else?
|
|
|
|
|
oops- MAPI is what I was looking for
|
|
|
|
|
Check MSDN, the MAPI methods, oddly enough, are prefixed with mapi. I.E. MAPILogon, MAPISendMail, etc.
|
|
|
|
|
I have a group-box enclosing 4 check boxes. I want to keep the group box, but I also want to be able to check any number of the check boxes. How can I do this?
As well, how can I keep my SDI formview based app from being re-sized?
Thanks, John.
|
|
|
|
|
Er - from memory if you play with the Group check box in the properties of the cb controls, you should get it - works for radio buttons too I think.
In InitInstance you'll see the main window handled - if you call ModifyStyle to remove the WS_THICKFRAME style for it you should effectively make the window unresizable. Hmmmm might look at WM_MAXIMIZEBOX as well..
|
|
|
|
|
Check a checkbox with CheckDlgButton() - it doesn't matter how many you have or whether they're in a group box.
--Mike--
http://home.inreach.com/mdunn/
Sometimes, arming yourself with a big pointy stake just won't do you any good.
|
|
|
|
|
Still looking for an answer to....
MSDN states:
"While it is normal to derive your own dialog classes from CDialog, you do not typically derive your own class for a dialog bar. Dialog bars are extensions to a main window and any dialog-bar control-notification messages, such as BN_CLICKED or EN_CHANGE, will be sent to the parent of the dialog bar — the main window."
I do not know how to use a dialog bar's controls. I can load the dialog bar, but I can't activate the bottons so they may be pressed, I can't set text in textboxes, I can't set the status of check-boxes. How are you supposed to get variables associated with the controls on the dialog bar if you don't have a derived class.
Thanks, John
|
|
|
|
|
Your need a command handler implemented in CMainFrame class to enable button and respond to events. You just have to add this manually. Assuming that your button has and IDC_BUTTON1 id, you have to:
1) insert member declaration in Mainfrm.h:
afx_msg void OnButton1();
Add this line outside the //{{AFX_MSG block
2) insert member definition in Mainfrm.cpp
void CMainFrame::OnButton1()
{
AfxMessageBox("Button1 pressed.");
}
3) add appropriate entry to message map in Mainfrm.cpp
ON_COMMAND(IDC_BUTTON1, OnButton1)
It's safer to have this line outside the //{{AFX_MSG_MAP block - ClassWizard has the tendency to overwrite stuff inside //{{AFX_xxx.
Well, that's all - you should see the msgbox after pressing the button. If you want to conditionally enable/disable control (like toolbar buttons or menu items), use ON_UPDATE_COMMAND_UI macro.
How are you supposed to get variables associated with the controls on the dialog bar if you don't have a derived class
Your CMainFrame probably has a CDialogBar member, say m_dlgbar. Use m_dlgbar.GetDlgItem(IDC_YOURCONTROL) to get access to specific controls. For example, to get access to edit box located on a dialog bar, use this:
CEdit *pEdit = (CEdit *)m_dlgbar.GetDlgItem(IDC_MYEDIT1);
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi,
Is there a possibility to catch when the program is under debug mode of MSVC or not ? ( program is with the debug info in the both cases )
|
|
|
|
|
|
I would really appreciate it if someone would give me a little help with trying to get my program to save the state of the toolbars when I exit. I am using standard MFC generated CToolbar objects and calling the GetToolBarCtrl function to access the CToolbarCtrl functions and trying to use SaveState. Following is my code. The SettingsRegKey is a Cstring with the path to my program in the registry that already exists although the value the SaveState function is supposed to add does not. Any ideas why it is not working? Thank you very much
CString SettingsRegKey = _T("Software\\Star\\Star\\Settings");
m_wndStandardToolBar.GetToolBarCtrl().SaveState(HKEY_CURRENT_USER, SettingsRegKey, _T("Standard ToolBar"));
|
|
|
|
|
Hey!
I've got a plugin system working in my app and it works
great. One thing I'd like to be able to do is to have
some of the plug-ins automatically doc themselves to
the app window (like a toolbar). I've tried several
methods, but haven't figured it out yet.
Any help?
Steve The Plant
|
|
|
|
|
I think I wrote that question too quickly.
I guess it would help to say that I'm working in MFC. And
that each plugin is stored in a DLL. So, that means I wonder
if there's a way to dock a toolbar (that's basically just
a CToolBar or Docking Dialog bar) stored inside a DLL onto my
main app frame.
I've tried passing the window handle and the actual pointer
of the main frame to the DLL and then trying to dock the
toolbar (contained inside the DLL), but it doesn't work. I
get assertions and other errors.
I do call that AFX_ function (forgot the name since I'm
not at work) inside each DLL function before doing anything
in MFC. Does anybody have any suggestions? Ideas?
Steve The Plant
|
|
|
|
|
What kind of DLL it is? Is it an 'extension DLL' (sharing a copy of MFC with the app) or 'regular DLL'?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
It's just a "regular" DLL. The Toolbar stored in the DLL would
be created and docked at runtime.
Steve The Plant
|
|
|
|