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 / User Input Data

Author
Message
Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 2nd Aug 2009 00:16
Hey,

I searched and learned about iostream and cin and cout simple commands. And learned how to make more little advanced stuff.
But iostream cant be included. In my projects.

Like this:



And is there another way to do it in DarkGDK?

Thanks,

Red Eye

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
Drowneath
15
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 2nd Aug 2009 05:29 Edited at: 2nd Aug 2009 05:32
Maybe something like...



But you'll need to filter the input manually, also implement the backspace.
Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 2nd Aug 2009 21:54
Thank you a bunch. Gonna experiment with that.

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
MFC Coder
15
Years of Service
User Offline
Joined: 5th Mar 2009
Location:
Posted: 3rd Aug 2009 09:13
I just started with the DarkGDK and came up with this:



Here, instead of going for a direct C++ approach I tried to do a direct DBPro conversion as best I could.

This code compiles and runs fine, although I could be way off in my approach as I a just beginning.
DnB
15
Years of Service
User Offline
Joined: 28th Feb 2009
Location:
Posted: 10th Aug 2009 14:52
Ah, yes! Excellent MFC Coder! That works nicely. I missed the dbVal command and I was trying to do it on my own, and thats what I needed. Although in my case I didn't need to static cast it afterwords.

And If I want to print the value back out to the screen (ill just use the same variable nInput) I use

Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 10th Aug 2009 17:44
@DnB

That will cause memory leaks, since dbStr() dynamically allocates more memory each time it is called, and you are not deleting it properly.

This is how you properly use it:



Or you can use sprintf, which I think is the safest and easiest way.



http://www.cplusplus.com/reference/clibrary/cstdio/sprintf/

Your_Health = (My_Mood == HAPPY) ? 100 : NULL;

Login to post a reply

Server time is: 2024-10-01 10:34:02
Your offset time is: 2024-10-01 10:34:02