首页 > 代码库 > VS2013 中 CString类型转换为LPCSTR类型

VS2013 中 CString类型转换为LPCSTR类型

    HWND hWnd = ::FindWindow(NULL, L"XXXXXXX");	if (hWnd != NULL)	{		DWORD dwReadBytes;		unsigned char *lpbuffer = (unsigned char *)malloc(10 * 1024 * 1024);;				USES_CONVERSION;		LPCSTR path = (LPCSTR)T2A(m_strDescPath); //m_strDescPath为一edit组件的成员变量		HFILE splhandle = _lopen(path, 0);		dwReadBytes = _lread(splhandle, lpbuffer, 10 * 1024 * 1024);		COPYDATASTRUCT cpd; /*给COPYDATASTRUCT结构赋值*/							//cpd.dwData = http://www.mamicode.com/1;                                                                                                         //标志发送字符串"字符串")+1;							//cpd.lpData = "http://www.mamicode.com/字符串";							//::SendMessage(hWnd,WM_COPYDATA,NULL,(LPARAM)&cpd);//发送!		cpd.dwData = http://www.mamicode.com/1; //标志发送CString类型>

  

VS2013 中 CString类型转换为LPCSTR类型