How to convert std::string to DWORD

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BoneKeeper
    New Member
    • May 2010
    • 4

    How to convert std::string to DWORD

    i need help to convert this:

    Code:
    char Pointer[255];
    
    GetPrivateProfileString("GENERAL","PointerName",NULL, Pointer, 254,"./Settings.ini");
    after i read the value of the setting file i can't convert it to DWORD, need help with this


    thx in advance

    //BoneKeeper
  • YarrOfDoom
    Recognized Expert Top Contributor
    • Aug 2007
    • 1243

    #2
    I might be missing something here, but I feel I should point out that DWORD is an integer type, not a string type.
    More info here.

    Comment

    • Banfa
      Recognized Expert Expert
      • Feb 2006
      • 9067

      #3
      You don't have a std::string you have an array of char (presumably zero terminated.

      If GetPrivateprofi leInt doesn't work for you try atoi.

      Comment

      • BoneKeeper
        New Member
        • May 2010
        • 4

        #4
        yeah i solved it ^^

        Code:
        DWORD dPointer = GetPrivateProfileInt("GENERAL","PointerName", NULL,"./Settings.ini");
        what i missed when i read was that the read function was a string and not a int ^^

        Comment

        Working...