I really need help

May 23, 2014 at 10:20pm
Hi. I have created a text editor. Everything works fine except there is this text file when i load it, I can't type any characeter keys in it. All i can type is the backspace key and the arrow keys. When I type a character key like the a key nothing happens. When I open this file in Notepad everything works fine.
I can open and modify other files in the text editor without problem.
This is the code i used to create the edit box in the WM_CREATE case
This is a non unicode text file
 
hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", NULL, WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL | ES_MULTILINE | ES_NOHIDESEL, 0, 0, 0, 0, hwnd, (HMENU)ID_MAIN_EDIT, (HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE), NULL);

I handle the sizing in WM_SIZE message.
I have also used the text editor from theForgers tutorial form the app_two example and im having the same problem too. I can email you the text file if you want and you can load it in the app_two example text editor and see for yourself

Please help
Last edited on May 23, 2014 at 10:23pm
May 23, 2014 at 11:04pm
Are the file attributes set to read-only?
Last edited on May 23, 2014 at 11:05pm
May 24, 2014 at 9:24am
No they're not. The file just has an archive attribute
May 24, 2014 at 10:24am
How big is the text file? Does it help if you increase the text limit of the edit control?

http://msdn.microsoft.com/en-us/library/windows/desktop/bb761647%28v=vs.85%29.aspx
May 24, 2014 at 10:29pm
Thanks knn9
File size was 403 KB(413,161 bytes)
I increased edit box text limit and now everything works
Do you know what the maximum edit box text limit is for windows xp?
Last edited on May 25, 2014 at 2:08am
May 25, 2014 at 2:59am
msdn wrote:
Before EM_SETLIMITTEXT is called, the default limit for the amount of text a user can enter in an edit control is 32,767 characters.

Edit controls on Windows NT/2000/XP: For single-line edit controls, the text limit is either 0x7FFFFFFE bytes or the value of the wParam parameter, whichever is smaller. For multiline edit controls, this value is either –1 bytes or the value of the wParam parameter, whichever is smaller.
Last edited on May 25, 2014 at 2:59am
Topic archived. No new replies allowed.