Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Text Buffer

Author
Message
SushiBox
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Ohio
Posted: 23rd Jan 2009 15:34
Ok I am trying to get text inputted while you type but for some reason with small edits trying to get it to work, I either see nothing or crashes on start.



Anyone know a better way or why this is happening? Other people on my team say strcpy is giving them trouble too.

I am working on a 2D Side Scrolling MMORPG, the journey is being blogged and I suggest you check it out. Will include all progress, road blocks even drama! http://exoengine.com/blog/
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Jan 2009 19:05 Edited at: 23rd Jan 2009 19:07
Is this the problem?


You can't get a string length from a null pointer.
Also, you have a memory leak there - Txt needs to be delete[]'ed after you've finished with it.

Rather than try and fix your code, here's an alternative dbEntry that cleans up backspaces, and an example of how it should be used:


Note that the official dbEntry and my alternative are used in exactly the same way - you get a new string each time, and it's up to you to delete[] it.

Login to post a reply

Server time is: 2024-09-30 15:23:07
Your offset time is: 2024-09-30 15:23:07