Yo,
I'm writing an app that allows people to edit text data together in a single edit box over a network connection.
On each keypress by the user in control over the edit, a message is sent telling them which char was pressed at which point the receiver's edit calls a CEdit::OnChar(ch, 0, 0); to simulate the keypress in his window.
I am quite perplexed with the situation at hand for the reason that the code is quite simple and straightforward.
In my OnChar(), CNetEdit::OnChar(...), I have a messagebox displaying what nChar was passed before my CEdit::OnChar(...) call and it is indeed what was sent from the client, but the call does seemingly nothing!
When I type directly into the edit, the call works fine.
I have tried other variants in the code, but to no avail. For example:
Code:
void CNetEdit::OnChar(UINT ch) {
OnKeyDown(ch, 0, 0);// call CNetEdit's messagemapped func
//or
OnChar(ch, 0, 0);// call CNetEdit's messagemapped func
//or
CEdit::OnKeyDown(ch, 0, 0);
//or
CEdit::OnChar(ch, 0, 0);
}
Please tell me you have some type of hint as to what I could be doing wrong. Thanks much in advance.
[EDIT]
I have altered the public accessor function that calls the protected OnChar() to accept the nRepCnt and nFlags of the keypress, but there is still no change...
[EDIT]
Okay, I actually made it work. I kept trying to call my messagemapped OnChar() func which wasn't working, but using a PostMessage(WM_CHAR,...) did work.. I still don't understand what the problem was, but it is working.. If you know, please explain. Thanks.