wstring

来源:互联网 发布:原油api最新数据 编辑:程序博客网 时间:2024/06/05 05:31
     TCHAR   tszExePath[MAX_PATH] = {0}; //定义一个字符数组
   
    GetModuleFileName(NULL, tszExePath, MAX_PATH); //给字符数组赋值

    wstring wsTemp = tszExePath; //用字符数组的地址初始化wstring 变量.
    wstring wsPath = wsTemp.substr(0, wsTemp.find_last_of(L"//") + 1); // 使用wstring的封装函数.

    wcscpy(m_tszCurrentDir, wsPath.c_str()); // 使用wstring的数据.
0 0
原创粉丝点击