Jump to content
  • Advertisement
Sign in to follow this  
FlyingDemon

win32 edit box freezing/laggin app

This topic is 5465 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here is my problem: I have an edit box that i have declared in a resource file: (created with the MinGW resource editor) CONTROL "",ID_IN_FIRE_GRP_NUM,"Edit",0x50012000,80,44,24,9,0x00000200 Now I can read data from the edit box just fine, but when it comes to writing stuff to it, it will either freeze my program, or seriously lagg it; To the point were i have to wait 2 mins for the screen to redraw! (3ghz) The edit box is used to store numbers, but having ES_NUMBERS set makes no difference. I know that the HWND and Resource ID's are correct because I have other controls that work properly, EVEN OTHER EDIT BOXS THAT WORK, EVEN THOUGH IM MODIFYING THEM IN EXACTLY THE SAME WAY! To send data to the Edit Box i've tried: SendDlgItemMessage(hwnd, ID_IN_FIRE_GRP_NUM, WM_SETTEXT, 0, (LPARAM)buffer); Where 'buffer' is a null-terminated string. and SetDlgItemText(hwnd, ID_IN_FIRE_GRP_NUM, buffer); Where 'buffer' is a null-terminated string. SetDlgItemInt(hwnd, ID_IN_FIRE_GRP_NUM, 0, false); Where i just tried to set the edit box text to "0" I've tried a many other combinations. And after many hours searching through MSDN and forums, I dont see what wrong with this code, or if im just missiing something. But Like i said i have other edit boxes that are defined the exact same in the resource file, except with a different resource id, and are modified in the same way.

Share this post


Link to post
Share on other sites
Advertisement
You say you are also reading data from it.

Are you probably reading on EN_CHANGE? And if you do so, do you re-set the text during EN_CHANGE?

This would cause a heavy endless message sending going on. EN_CHANGE will also be sent when you use SetWindowText on the edit.

Either have an bool to not process EN_CHANGE during a SetWindowText call or either only call SetWindowText when the content is different (may require a GetWindowText).

Share this post


Link to post
Share on other sites
Thank You Endurion, I guess that infinite message sendage was the cause of my problems.

But still, why didn't it happen to the other edit boxs? - Weird.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!