如何将CString转换为DWORD类型?
比如:CString name="我靠!";咋整才能转换为DWORD类型?

解决方案 »

  1.   

    CString name="我靠!";
    char pStr[8];
    DWORD pULong[2];
    memset( pStr , 0 , 8 );
    strcpy( pStr , name );
    memcpy( pULong , pStr , 8 );
      

  2.   

    WCHAR wszDomain[256]; 
    CString name="我靠!";
    char pStr[8];MultiByteToWideChar( CP_ACP, 0, name,
    strlen(temp)+1, pStr, 
    sizeof(pStr)/sizeof(pStr[0]) );
    pStr就是转换后的值
      

  3.   

    char *p_char = (char*)(LPCTSTR)cstring;
    再....
      

  4.   

    http://dev.csdn.net/develop/article/12/12365.shtm