-
April 10th, 2010, 07:54 PM
#1
Need Some Information
Hey everyone, i'm new to Win32 API.
I just had a few questions:
1. If i need to get numbers from an EDIT box, i use GetWindowText, but i'm wondering, do you always need to convert the char to the specified data type (e.g. atoi(number)) ?
2. As i'm new i'm using char something[20] to put data into a buffer (i think), but ive seen another method:
something = (char*)GlobalAlloc(GPTR, 50) and GlobalFree((HANDLE)something);
I'm wondering, is there any difference, e.g. stable, efficiency, speed?
Thank,
Russell
-
April 11th, 2010, 10:29 AM
#2
Re: Need Some Information
For 1., it looks like you answered your own question.
For 2., GlobalAlloc and GlobalFree are used mainly for passing buffers between diverse processes. You can just use the C++ new[] and delete[] operators if you just need local memory buffers for your app.
-
April 11th, 2010, 11:33 AM
#3
Re: Need Some Information
If you want to get Integer from EDIT box, you can use GetDlgItemInt(). This way you don't have to convert char into integer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|