int WINAPI _tWinMain(HINSTANCE hinstExe, HINSTANCE, PTSTR pszCmdLine, int) { // This event is just used to determine which instance this is. HANDLE hevt = CreateEvent(NULL, FALSE, FALSE, TEXT("OptexTest")); if (GetLastError() != ERROR_ALREADY_EXISTS) { // This is the first instance of this test application // First, let's test the single-process optex COptex optexSingle; // Create a single-process optex FirstFunc(TRUE, optexSingle); // Now, let's test the cross-process optex COptex optexCross("CrossOptexTest"); // Create a cross-process optex FirstFunc(FALSE, optexCross); } else { // This is the second instance of this test application DebugBreak(); // Force debugger connection for tracing // Test the cross-process optex COptex optexCross("CrossOptexTest"); // Create a cross-process optex SecondFunc((PVOID) &optexCross); } CloseHandle(hevt); return(0); } 是不是 这里第2个实例运行的时候进入_tWinMain 然后因为已经有了OptexTest的运行实例了 所以返回了ERROR_ALREADY_EXISTS然后第2个实例就停在了DebugBreak(); // Force debugger connection for tracing? 对么?
int WINAPI _tWinMain(HINSTANCE hinstExe, HINSTANCE, PTSTR pszCmdLine, int) { // This event is just used to determine which instance this is.
HANDLE hevt = CreateEvent(NULL, FALSE, FALSE, TEXT("OptexTest")); if (GetLastError() != ERROR_ALREADY_EXISTS) { // This is the first instance of this test application // First, let's test the single-process optex
COptex optexSingle; // Create a single-process optex
FirstFunc(TRUE, optexSingle); // Now, let's test the cross-process optex
COptex optexCross("CrossOptexTest"); // Create a cross-process optex
FirstFunc(FALSE, optexCross); } else { // This is the second instance of this test application
DebugBreak(); // Force debugger connection for tracing // Test the cross-process optex
COptex optexCross("CrossOptexTest"); // Create a cross-process optex
SecondFunc((PVOID) &optexCross);
} CloseHandle(hevt);
return(0);
}
是不是 这里第2个实例运行的时候进入_tWinMain 然后因为已经有了OptexTest的运行实例了 所以返回了ERROR_ALREADY_EXISTS然后第2个实例就停在了DebugBreak(); // Force debugger connection for tracing?
对么?
iLength = SendMessage (hwndEdit, EM_GETLINE, iLine,(LPARAM) szCommand) ;还有个问题就似乎对这个很不理解阿 这个...这个是个新问题 算我无赖了..
就是* (WORD *) szCommand 到底是做什么用的 为什么这么写?