Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C++ string to int

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Fri Apr 04, 2008 11:06 pm    Post subject: C++ string to int Reply with quote

i've got a LPTSTR, and im trying to convert it to an integer, so i can use it for a Sleep command
_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Apr 05, 2008 12:15 am    Post subject: Reply with quote

I'm taking a guess that you're letting the user input the delay?

GetDlgItemInt

otherwise, outside of x0r's answer, what about stringstream?
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Sat Apr 05, 2008 12:32 am    Post subject: Reply with quote

ahh thanks, could be handy, but is there a way to do it without the dlg item, i haven't defined em
_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Apr 05, 2008 12:35 am    Post subject: Reply with quote

Where's the string coming from then?
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Sat Apr 05, 2008 12:44 am    Post subject: Reply with quote

like using WM_GetString, but without using the dlgitem value, i haven't defined em
_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Apr 05, 2008 1:24 am    Post subject: Reply with quote

e: I seriously have down syndrome and will stop replying half asleep.

If by WM_GETSTRING do you mean EM_GETLINE / WM_GETTEXT?


Last edited by hcavolsdsadgadsg on Sat Apr 05, 2008 3:13 am; edited 1 time in total
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Sat Apr 05, 2008 1:41 am    Post subject: Reply with quote

well i think i am using dialogs

i tried to do that yeh, but my conversion screwed up, theres a a thread about it in this section, see if you can find out the problem

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Apr 05, 2008 3:14 pm    Post subject: Reply with quote

If you are using Dialogs, just use the function Slovach already mentioned above.

GetDlgItemInt to obtain an int value.
GetDlgItemText to obtain the string value.

You can also use GetWindowText( ) or SendMessage with WM_GETTEXT.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Apr 05, 2008 3:36 pm    Post subject: Reply with quote

You don't have to be using dialogs to use GetDlgItemInt/Text or any of it's buddies. Wink

You can use it all the same if you created the window and everything yourself.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Apr 05, 2008 3:44 pm    Post subject: Reply with quote

slovach wrote:
You don't have to be using dialogs to use GetDlgItemInt/Text or any of it's buddies. Wink

You can use it all the same if you created the window and everything yourself.


Yeah, it's just a wrapper for GetWindowText.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites