不能将参数 2 从“LPSTR”转换为“LPTSTR”
代码是这么写的
typedef struct _RemotePara{ // 参数结构.
char pMessageBox[50];
DWORD dwMessageBox;
STARTUPINFO si;
PROCESS_INFORMATION pi;
}RemotePara;
//---------------------------------------------------------------------------
// 远程线程.
DWORD __stdcall ThreadProc (RemotePara *lpPara){
// 定义MessageBox函数.
/* typedef int (WINAPI *MMessageBoxA)(HWND,LPCTSTR,LPCTSTR,DWORD);
MMessageBoxA myMessageBoxA;
myMessageBoxA =(MMessageBoxA)lpPara->dwMessageBox;// 得到函数入口地址.
myMessageBoxA(NULL,lpPara->pMessageBox ,lpPara->pMessageBox,0);*/
typedef BOOL (*CREATEPRO)(
LPCTSTR lpApplicationName,
LPTSTR lpCommandLine, // pointer to command line string
LPSECURITY_ATTRIBUTES lpProcessAttributes, // process security attributes
LPSECURITY_ATTRIBUTES lpThreadAttributes, // thread security attributes
BOOL bInheritHandles, // handle inheritance flag
DWORD dwCreationFlags, // creation flags
LPVOID lpEnvironment, // pointer to new environment block
LPCTSTR lpCurrentDirectory, // pointer to current directory name
LPSTARTUPINFO lpStartupInfo, // pointer to STARTUPINFO
LPPROCESS_INFORMATION lpProcessInformation // pointer to PROCESS_INFORMATION
);
CREATEPRO CreateProc=(CREATEPRO)lpPara->dwMessageBox;
CreateProc(NULL,(LPSTR)lpPara->pMessageBox,NULL,NULL,FALSE,CREATE_NEW_CONSOLE,NULL,NULL,&lpPara->si,&lpPara->pi);
return 0;
}
CreateProc(NULL,(LPSTR)lpPara->pMessageBox 这里出错 我不晓得为什么
分别提示
不能将参数 2 从“LPSTR”转换为“LPTSTR”
不能将参数 1 从“LPSECURITY_ATTRIBUTES”转换为“LPCTSTR”