|
Hi Shashi,
Yes. cursor is focused in test editor.
I think i have not written code for handling the delete key event.
Please tell me if you know how to handle this ???
Thanks in advance
Sanjeeva Kumar.
|
|
|
|
|
Sanjeeva Kumar K wrote: I think i have not written code for handling the delete key event.
But did you not earlier state that, "If i select some text and if i press 'Delete' button then my tool is deleting the selected text."?
In your deletion code, are you first checking to see if any text is selected?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have written code for deleting characters only if some text is selected.
If i simply press the 'Delete' button then this function is not invoked.
do i need to handle it separately ???
Regards,
Sanjeeva Kumar.
|
|
|
|
|
Sanjeeva Kumar K wrote: do i need to handle it separately ???
I would think so.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I think u don't need to override the WM_KEYDOWN message. it will all happen automatically.
or if u need to override for some reason then call base implementation in overridden function
eg: If you are using the CEdit then you need to call the CEdit::OnKeyDown in ON_WM_KEYDOWN Message Handler function. Or if you are using a Win32 then u need call the Old Window procedure in your own window proc. i mean leave the deleting to the default message handler. that's it.
BEGIN_MESSAGE_MAP(CMyEdit, CEdit)
ON_WM_KEYDOWN(OnMyEditeyDown)
END_MESSAGE_MAP()
void CMyEdit::OnMyEditeyDown( UINT nChar,
UINT nRepCnt,
UINT nFlags )
{
CEdit::OnKeyDown(nChar,nRepCnt,nFlags);
// to Do
}
i think this will help you
|
|
|
|
|
Thanks Nitheesh. I will try this.
|
|
|
|
|
Hi all,
For a long time I'm worried about this and still don't found the correct way.
Say I have a function as follows.
void addData(string name, char gender)
{
}
But I can't send name and gender to addData() function within a single function. One function find the name and another function find the gender.
void getName()
{
}
void getGender()
{
}
How can I send those values to the addData() function using two functions as shown above.
I appreciate your help all the time...
Eranga
|
|
|
|
|
You cannot have two different functions send one argument each to a function that accepts two arguments. I really don't understand your problem clearly though.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
what about:
void getName( string & name)
{
}
char getGender()
{
}
and then
string name;
char gender;
getName(name);
gender = getGender();
addData(name, gender);
?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
CPallini wrote: string name;
char gender;
getName(name);
I'm not clear this code. I mean that looking to find the name using getName() function.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Eranga Thennakoon wrote: I'm not clear this code. I mean that looking to find the name using getName() function.
It assigns the found name to the passed parameter.
Could you please post your actual getName code?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
You actually understood his query? Man you're too good.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: You actually understood his query?
I try my best guessing about.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
CPallini wrote: I try my best guessing about.
I got that now.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Eranga Thennakoon wrote:
How can I send those values to the addData() function using two functions as shown above.
You can't. The two functions you've shown have no way of sending data back to the caller. If you are allowed to change them, something like:
string getName( void )
{
}
char getGender( void )
{
}
...
addData(getName(), getGender()); might work.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
how to show Menubar on the DialogBOX resource and use it
in both plain sdk or MFC
Trioum
|
|
|
|
|
SetMenu( HMENU ) works.
Greetings from Germany
|
|
|
|
|
Use LoadMenu API or CMenu::LoadMenu
then use SetMenu API or CMenu::SetMenu
|
|
|
|
|
how can use ATL CImage class with out using MFC (with plain win 32API).
whether I have to ship any dll (or .net frame work)with my project binary . I am using visual studio 2005 with unmanaged c++
|
|
|
|
|
|
dear all
if now i have a array which contains 10 values, for example, kelly[10],how to save this array as a txt file or other extension file. thanks
Li Zhiyuan
5/10/2006
|
|
|
|
|
You may use:
(1) a text format for a human readable file.
(2) a binary format for later retrieval of array values.
Regarding the API , you have a lot of options: the std::ofstream class methods or standard C functions (fopen, fwrite, fclose ), the Win32 API (like CreateFile, WriteFile, CloseHandle functions) or the MFC classes (like CFile , CStdioFile ), ...
Moreover, I think it is time (considering all your previous posts) to have a look at MFC serialization [^] topic.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
dear friend
how to understand the following code:
ofs.write( (char*)&count, sizeof(count));that means char*;
how to save using std::ofstream? thanks a lot,...urgent..
second question is that can you provide me the stuff: for example: %d,if%, and so forth..i read them before, but so far i couldn't find these matierials, thanks a lot.
Li Zhiyuan
5/10/2006
|
|
|
|
|
To write some data to the file, the ostream object needs to know
(1) the address of the data.
(2) the size of the data.
(1) Well, &count means exactly the address of the variable count (as int pointer) and (char *) is a cast of the int pointer to a char one (ostream works on byte basis and it requires a char pointer, a char is 1-byte long, after all...).
(2) sizeof(count) is the size of count , i.e. the size of an integer variable (i.e. 4 bytes).
li zhiyuan wrote: second question is that can you provide me the stuff: for example: %d,if%, and so forth
%d, %f are format specifiers for the printf (as well for fprintf , fscanf functions): whenever you need to print a particular type using such function(s) then you have to use the proper format specifier, for instance
int i= 100;
float f = 3.14159;
printf("An integer, i=%d, a float f=%f\n", i, f);
Full documentation can be found here http://msdn2.microsoft.com/en-us/library/hf4y5e3w(VS.71).aspx[^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
dear friend
thank u very much.
how to create 10 3x4 arrays, late when i wanna use anyone of them, i can invoke it, i tried two days already, could not solve this problem,..really urgent now...thanks a lot..
how can i find full explanation of format specifier: &d,%1f........i need to read recall them..forgot it already..thanks a lot
Li Zhiyuan
5/10/2006
|
|
|
|