|
yes
the code below <b>else </b> is where I need your kindly help.
if (!GetFocus()->IsKindOf(RUNTIME_CLASS(CEdit)))
return true;// do nothing and ignore the key process
else
{
<u><b> ...............
//add proper code for EDIT control capture the Enter and ESC key.</b></u>
}
|
|
|
|
|
Why are you doing that in PreTranslateMessage ? I think you can simply add a message handler for WM_CHAR or WM_KEYDOWN for the edit control no ? I'm not sure about that, so you have to check.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
I tried, and failed......
if there is no better methord,I would have to add the edit proc function in PreTranslateMessage() directly...
|
|
|
|
|
zeus_master wrote: if (!GetFocus()->IsKindOf(RUNTIME_CLASS(CEdit)))
return true;
Your logic seems to be wrong. You want the condition to be true right?
[modified]
By returning true from PreTranslateMessage(...), you are telling your application to bypass any default handling of the message.
[modified]
Last modified: Tuesday, June 20, 2006 3:28:49 AM --
|
|
|
|
|
GetFocus()->IsKindOf(RUNTIME_CLASS(CEdit)) is for checking current focus on Edit control or not.
if it is not on edit control, will return and do nothing,if the focus is on edit control, then do what I want to....
-- modified at 4:35 Tuesday 20th June, 2006
By returning true from PreTranslateMessage(...), you are telling your application to bypass any default handling of the message.
yes, or it will close the dialog
|
|
|
|
|
zeus_master wrote: GetFocus()->IsKindOf(RUNTIME_CLASS(CEdit))
If this return true it means the current focus is in an edit control (could be any edit control). If it return false, it mean focus is not in any edit control.
zeus_master wrote: f the focus is on edit control, then do what I want to
Then you code should be:
if (GetFocus()->IsKindOf(RUNTIME_CLASS(CEdit)))
{
}
|
|
|
|
|
I wonder why nobody suggested overriding the "onOk" and "onCancel" functions of the CDialog. , that's the simplest way to get rid of your 'escape' and 'enter'.
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
|
|
|
|
|
thank you for you suggestion, Ceric Moonen suggested me also.
now the problem is how do single-line Edit control capture the Enter/Esc key.
|
|
|
|
|
I am using a drop down list CComboBoxEx and I am seeing a very strange behaviour(bug?).
When I left click on the ComboBoxEx, the list drops down. If I do not move the mouse and do not select any item in the list and then perform another left click, the list will close up and then drop down again.
If I right click or select an item and left click instead, the list will just close up correctly.
Does anyone knows how to solve this problem ?
PS. The ComboBox works fine, but Project need to use ComboBoxEx .
|
|
|
|
|
Is there someone that know how to solve this problem?
any answer will be greatly appreciated.
|
|
|
|
|
I created a test project to try out your problem here but i dont have that issue like you described. Does your control looks like losing focus and getting it back again in a split sec?
|
|
|
|
|
Thank you for taking time to test this.
This happens in VC6 SP6,WinXP and Win2k
I have found the same problem in
www.codeguru.com/forum/archive/index.php/t-354179.html
but there is no answer
Thank you in advance
|
|
|
|
|
hi
My application is dialog based.
at the time of running,if u press Esc key
then it is closed. how can i prevent this.
can any one help me?
thanx
rai
|
|
|
|
|
aaaan wrote: My application is dialog based.
at the time of running,if u press Esc key
then it is closed. how can i prevent this.
can any one help me?
See the following code
BOOL CmyApp::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_KEYDOWN && (VK_ESCAPE == pMsg->wParam || VK_RETURN == pMsg->wParam))
pMsg->wParam=NULL;
return CWinApp::PreTranslateMessage(pMsg);
}
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
|
|
|
Hi...
i got problem when compiling & linking my app in visualC++. I got the error msg like this:
------------------- the error msg -------------------
Linking...
Cobalagiah.obj : error LNK2001: unresolved external symbol "public: static int __cdecl ReadBitstreamFile::create(class ReadBitstreamFile * &)" (?create@ReadBitstreamFile@@SAHAAPAV1@@Z)
Debug/Cobalagiah.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Cobalagiah.exe - 2 error(s), 0 warning(s)
------------------- end of the error msg -------------------
the situation is as follow. there is one workspace with many projects in it. I have to make my own project in the same workspace and utilize some classes from other projects (within the same workspace).
So i set the directory paths to include the other header files (Tools - Options - Directories tab). by doing that i can put the code #include "ReadBitstreamFile.h" and compiling it was ok.
but then when I put this code in the main function (just for testing)
----------------- my testing code -----------------
int main(int argc, char* argv[])
{
ReadBitstreamFile *pcReadBitstreamFile;
ReadBitstreamFile::create( pcReadBitstreamFile );
printf("Hello World!\n");
return 0;
}
----------------- end of my testing code -----------------
that error occurs. note that the "create" function is a static function. it is defined in other class in other project.
anybody can help, please?
regards,
Hendry
email at: hendry197-at-msn-dot-com
|
|
|
|
|
You have also to add the cpp file in which ReadBitstreamFile is defined to your project. Do that simply by tight-clicking on the file views on the directory with the source files of your project. Then select add file (or something similar, depends of the IDE you are using).
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
hendry197 wrote: that error occurs. note that the "create" function is a static function. it is defined in other class in other project.
Is this other project a library? If so, you need to include the header and add that lib to your project.
|
|
|
|
|
maybe you need to import library(lib) in your program
whitesky
|
|
|
|
|
I just tried it. I just tried to add the path to the .obj (.obj is like lib too, right?) files too. it seems work. thank you guys ^_^
regards,
Hendry
|
|
|
|
|
hi all
i have a problem .
In Listbox by typing the first character of a selection the item can be selected
is it possible to restrict this property of list box
if possible how??
"Men never do evil so completely and cheerfully as when they do it from religious conviction"
-Pascal
|
|
|
|
|
|
Can you be more specific
whitesky
|
|
|
|