|
Works for me - I've created dialog-based app, added menus to main dialog and about box and everything works as expected.
Are you playing with PreTranslateMessage?
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
This is not a dialog based app but a dialog called by an SDI app. I am not touching PreTranslateMessage.
Dave Huff
Igor would you give me a hand with the bags?
Certainly - you take the blonde and I'll take the one in the turban!
|
|
|
|
|
I made a SDI application that opens a dialog (modal) with a menu.
work fine.
Are you using modeless dialogs?? (i did not try it)
Casa.Sapo.pt
|
|
|
|
|
for dialogs, you can load the accelerators yourself, in PreTranslateMessage:
BOOL ColorEditWnd::PreTranslateMessage(MSG* pMsg)
{
if (m_bUseKBAccel)
{
if ((pMsg->message == WM_KEYDOWN) && (pMsg->hwnd == m_hWnd))
{
HACCEL hAccel = LoadAccelerators( AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_EDIT_ACCELS) );
if (::TranslateAccelerator( m_hWnd, hAccel, pMsg ) )
{
return TRUE;
}
else
{
return CWnd::PreTranslateMessage(pMsg);
}
}
}
return CWnd::PreTranslateMessage(pMsg);
}
-c
Gourmet, n:
Anyone whom, when you fail to finish something strange or
revolting, remarks that it's an acquired taste and that you're
leaving the best part.
|
|
|
|
|
Please dont suggest loading the accels on every keystroke. Do it in OnInitDialog at least.
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
that step was left to the reader.
thanks for contributing.
-c
"I am angry that so many of the sons of the powerful and well-placed... managed to wangle slots in Reserve and National Guard units...Of the many tragedies of Vietnam, this raw class discrimination strikes me as the most damaging to the ideal that all Americans are created equal and owe equal allegiance to their country."
--Colin Powell
|
|
|
|
|
In a dialog based application all keyboard events go to the control that have the focus. If you do not have any control on the form then I am pretty sure it will work. To use keystrokes you must, as Chris said, override the PreTranslateMessage method.
Best regards,
Alexandru Savescu
|
|
|
|
|
When I click on an item in a listctrl, it doesnt make it highlighted and blue. How do I get this to happen?
|
|
|
|
|
Has the control focus while it doesnt make the selection highlighted and blue? The selection is not displayed in blue while the control isn't focused if the "Show selection allways" is not set.
Pavel
Sonork 100.15206
|
|
|
|
|
the "show selection always' did the trick. Many many thanks!
ns
|
|
|
|
|
I have a file that I read character by character. However, the file is scattered with '^Z' (control-Z) characters so the process stops at the first of them due to
end-of-file. Is there a way to ignore these characters and continue reading till I
reach the "real" end of the file?
Thanks!
|
|
|
|
|
You need to open the file in binary (not text) mode. Are you using stdio or iostream?
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Thanks! That solved the problem. (I'm using iostream.)
|
|
|
|
|
HI ALL
I'm searching for code posted between 12 Aug 2002 and 19 Aug 2002 on CodeProject.
The article title: Exclusive Drag Drop enabled Tabbed Control
Does anybody have source for this article ??
If yes, please send me it.
|
|
|
|
|
I'm having a problem running my executable. The project has compiled and built successfully, but once I try to execute it, I receive the error message "The memory could not be written". If I debug, I receive an Unhandled Exception error, with Access Violation on NTDLL.DLL.
Please help! How do I grant myself write access to this file? I am the administrator of my machine.
Thanks!
Cintia
|
|
|
|
|
Cintch wrote:
How do I grant myself write access to this file?
You have a problem with invalid/uninitialized/dangling pointer, not with 'access to ntdll.dll'. Check the call stack when excetpion happens - you should see where's the error.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Did you feel any temptation to be slightly malicious with that response?
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
Jon Hulatt wrote:
Did you feel any temptation to be slightly malicious with that response?
I did
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
I had a similar problem when I ran a dialog application which OnPaint is done by OpenGL functions. The project compiles and runs well in Windows 2000, and terminate approperly. but when I ran it in Windows XP, when I close the application, after every object was destructed, I got this NTDLL.DLL write access unhandled exception error. If I debug it, the call stack is full of USER blah blah, and the code is all in assembly.
Could you give me any clue? Thanks!
|
|
|
|
|
lucy wrote:
the call stack is full of USER blah blah, and the code is all in assembly.
1) examine *full* stack - below series of USER32 calls, you may find your code
2) try switching between threads using Debug/Threads menu option; there's a chance the crash happened in some background thread and stack doesn't reflect the right context.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
I want to update values in a combo at runtime.
I have a combo box that allows the user to select between "metres" and "feet".The form shows a value in [m].
I want this value to change if and when the user chooses [ft] and I want the choice to be shown in static text next to the edit box.
Any suggestions
Kash
|
|
|
|
|
Alright kash....
Use Class Wizard to attach a CString to the Static Control, and a CComboBoxCtrl to the ComboBox.
Then Use Class Wizard again to catch the Message CBN_SELCHANGE for the ComboBox
in the function generated for that action,
OnSelChange...
int i = m_comboBox.GetCurSel();
switch (i) {
case 0:
m_string = "meters";
case 1:
m_string = "feet";
};
UpdateData(TRUE);
or something like that.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Jawache wrote:
UpdateData(TRUE);
Thats bad!!!
From now on, clicking cancel has changed your data.
This should not happen, because a user that clicks cancel specifically wants to leave the dialog *WITHOUT* change in the data.
But the call to UpdateData() copied the control status of all controls into the corresponding variables. So with cancel, they are changed.
So - do not fill the DDX-variable yourself and call UpdateData() !
Better use a control variable of type CStatic and do a SetWindowText() on it.
|
|
|
|
|
It should have been UpdateData(FALSE) anyway.
Usually you have the data stored seperately anyway.
if (Dialog.DoModal() == IDOK)
{
m_String = Dialog.m_String;
}
so only after a user clicks OK is the data stored away otherwise the old data is valid.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
try ON_CBN_SELCHANGE notify
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|