CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005
    Posts
    64

    _tcstol Conversion Problem...

    Hi,
    I have to convert a hex value to int, for that I use

    Variable are of foll. type..
    std::string pFirstStr
    wchar_t ptrTemp;

    nChar = _tcstol(pFirstByteStr.c_str(), &ptrTemp,16);//Problem is here

    as I have to support unicode.

    Can u suggest solution, by which I can convert a hex value in std::string variable to int using UNICODE supported function...

    Regs

  2. #2
    Join Date
    Apr 2005
    Location
    Norway
    Posts
    3,934

    Re: _tcstol Conversion Problem...

    Like this?
    Code:
    std::wstring pFirstStr
    wchar_t* ptrTemp; 
    
    nChar = _tcstol(pFirstByteStr.c_str(), &ptrTemp,16);//Problem is here
    or maybe something like this:
    Code:
    std:basic_string<TCHAR> pFirstStr;
    TCHAR*  ptrTemp;
    
    nChar = _tcstol(pFirstByteStr.c_str(), &ptrTemp,16);
    - petter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured