c++: how to convert wchar_t* to DWORD

I'm reading in a value from an INI file that is the frequency of which I need to perform an action during my file handling process.  The value will always be a postive numeric value.  Default is 32768 (32KB). When I use GetPrivateProfileString() I can read in the value but it comes in as a w_chart*.  I need a way to convert this value to a DWORD.  

Thanks.
i-mate05Asked:
Who is Participating?
 
jkrCommented:
Not a big deal, use

#include <stdlib.h>

wchar_t* p = L"32768";
DWORD dwValue = _wtol(p);
0
 
jkrCommented:
BTW, why don't you use 'GetPrivateProfileInt()' here in the 1st place?
0
 
i-mate05Author Commented:
Thanks for the reply jkr.  Honestly I didn't even realize that call existed. I'm using someone elses code as a guideline and I didn't even think to look for that.  Thank you again.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.