fork download
  1. HINSTANCE hinst;
  2.  
  3. int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR pszCmdLine, int iCmdShow)
  4. {
  5.  
  6. DialogBox(hinst, MAKEINTRESOURCE(IDD_MAIN), NULL, WndProc);
  7.  
  8.  
  9. //printf("Press ENTER to exit...");
  10. //return getchar();
  11.  
  12. //MessageBox(NULL, "安安", "安安", MB_OK | MB_ICONEXCLAMATION);
  13. //定義窗口類
  14. /*WNDCLASSEX wcx;
  15. HWND hwnd;
  16. //hinst hinstance;
  17. MSG msg;
  18. BOOL fGotMessage;
  19. wcx.lpszClassName = "mainwclass";
  20. wcx.cbSize = sizeof(wcx);
  21. wcx.style = CS_HREDRAW | CS_VREDRAW;
  22. wcx.lpfnWndProc = WndProc;
  23. wcx.cbClsExtra = 0;
  24. wcx.cbWndExtra = 0;
  25. wcx.hInstance = hInst;
  26. wcx.hIcon = LoadIcon(NULL, IDI_APPLICATION);
  27. wcx.hCursor = LoadCursor(NULL, IDC_ARROW);
  28. wcx.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
  29. wcx.lpszMenuName = NULL;
  30. wcx.hIconSm = (HICON)LoadImage(hinst,
  31. MAKEINTRESOURCE(5), IMAGE_ICON,
  32. GetSystemMetrics(SM_CXSMICON),
  33. GetSystemMetrics(SM_CXSMICON),
  34. LR_DEFAULTCOLOR);
  35.  
  36. if (!RegisterClassEx(&wcx))
  37. {
  38. return 1;
  39. }
  40. //使用窗口類創建窗口
  41. hwnd = CreateWindow("mainwclass",
  42. L"CMBS test",
  43. WS_OVERLAPPEDWINDOW,
  44. CW_USEDEFAULT,
  45. CW_USEDEFAULT,
  46. CW_USEDEFAULT,
  47. CW_USEDEFAULT,
  48. (HWND)NULL,
  49. (HMENU)NULL,
  50. hinst,
  51. (LPVOID)NULL);
  52. if (!hwnd)
  53. {
  54. return 1;
  55. }
  56. ShowWindow(hwnd, iCmdShow);
  57. UpdateWindow(hwnd);
  58. while (fGotMessage = GetMessage(&msg, (HWND)NULL, 0, 0) != 0)
  59. {
  60. TranslateMessage(&msg);
  61. DispatchMessage(&msg);
  62. }
  63. return msg.wParam;*/
  64. }
  65. HWND textfield;
  66. HWND list;
  67. //窗口過程處理消息
  68. //視窗處理勢丹執行續,如果有呼叫while loop 會造成視窗無法出現
  69. INT_PTR CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
  70. {
  71. BOOL bRet = TRUE;
  72. int number = 1;
  73. //TCHAR s[10] = L"hello";
  74. u8 u8_Port = 0;
  75. u8 btn4 = 0;
  76. TCHAR s[2] = L"H";
  77. //u8 u8_Port = 0;
  78. char *psz_XMLFile = NULL;
  79. char *psz_LogFile = NULL;
  80. char psz_HostLogFile[100] = { 0 };
  81. char *psz_TraceFile = NULL;
  82. char *psz_EEpromFile = NULL;
  83. char *psz_FirmwareFileName = NULL;
  84. char *psz_ComDevName = NULL;
  85. u8 u8_USB = 0;
  86. bool TDM_Type = 0;
  87. int iPacket = 32;
  88. ST_IE_SYPO_SPECIFICATION SYPOParameters;
  89. bool SYPO_enabled = FALSE;
  90. int eeprom_new = 0;
  91. int size = 0;
  92. int menu = 1;
  93. u16 u16_TargetVersion;
  94.  
  95. u8_Port = tcx_DetectComPort(TRUE, &g_st_DevCtl.e_DevType);
  96. itoa(u8_Port, s, 10);
  97. tcx_USBConfig(u8_Port, g_u32_BaudRate);
  98.  
  99. //task();
  100.  
  101. switch (uMsg)
  102. {
  103. case WM_INITDIALOG:
  104. list = GetDlgItem(hwnd, IDC_LIST1);
  105. break;
  106. case WM_CREATE:
  107.  
  108.  
  109.  
  110. break;
  111. case WM_CLOSE:
  112. EndDialog(hwnd, 0);
  113. break;
  114. case WM_COMMAND:
  115. switch (LOWORD(wParam))
  116. {
  117. case IDC_BUTTON1:
  118.  
  119. u8_Port = tcx_DetectComPort(TRUE, &g_st_DevCtl.e_DevType);
  120. tcx_USBConfig(u8_Port, g_u32_BaudRate);
  121. if (appcmbs_Initialize(NULL, &g_st_DevCtl, &g_st_DevMedia, &pfn_log_buffer_Cb) != CMBS_RC_OK)
  122. {
  123. CFR_DBG_ERROR("TCX ERROR: !!! Host could not be started up!\n");
  124. }
  125.  
  126. SetDlgItemText(hwnd,IDC_STATIC2,s);
  127.  
  128. break;
  129. case IDC_BUTTON2:
  130.  
  131. app_SrvSubscriptionOpenExt(120, CMBS_HS_REG_ENABLE_ALL);
  132. break;
  133. case IDC_BUTTON3:
  134. MessageBox(hwnd, TEXT("123"), TEXT("123"), MB_OK);
  135. app_HanRegularStart(FALSE);
  136. break;
  137. case IDC_BUTTON4:
  138. btn4 = 1;
  139. break;
  140.  
  141. default:
  142.  
  143. DefWindowProc(hwnd, uMsg, wParam, lParam);
  144.  
  145. break;
  146. }
  147.  
  148. break;
  149. default:
  150.  
  151. bRet = FALSE;//must add , if no add, can cash
  152. break;
  153. }
  154. return bRet;
  155.  
  156. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
HINSTANCE hinst;
^
Main.java:3: error: class, interface, or enum expected
int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR pszCmdLine, int iCmdShow)
^
Main.java:64: error: class, interface, or enum expected
}
^
Main.java:66: error: class, interface, or enum expected
HWND list;
^
Main.java:69: error: class, interface, or enum expected
INT_PTR CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
^
Main.java:72: error: class, interface, or enum expected
	int number = 1;
	^
Main.java:74: error: class, interface, or enum expected
	u8 u8_Port = 0;
	^
Main.java:75: error: class, interface, or enum expected
	u8 btn4 = 0;
	^
Main.java:76: error: class, interface, or enum expected
	TCHAR  s[2] = L"H";
	^
Main.java:78: error: class, interface, or enum expected
	char *psz_XMLFile = NULL;
	^
Main.java:79: error: class, interface, or enum expected
	char *psz_LogFile = NULL;
	^
Main.java:80: error: class, interface, or enum expected
	char psz_HostLogFile[100] = { 0 };
	^
Main.java:81: error: class, interface, or enum expected
	char *psz_TraceFile = NULL;
	^
Main.java:82: error: class, interface, or enum expected
	char *psz_EEpromFile = NULL;
	^
Main.java:83: error: class, interface, or enum expected
	char *psz_FirmwareFileName = NULL;
	^
Main.java:84: error: class, interface, or enum expected
	char *psz_ComDevName = NULL;
	^
Main.java:85: error: class, interface, or enum expected
	u8 u8_USB = 0;
	^
Main.java:86: error: class, interface, or enum expected
	bool TDM_Type = 0;
	^
Main.java:87: error: class, interface, or enum expected
	int iPacket = 32;
	^
Main.java:88: error: class, interface, or enum expected
	ST_IE_SYPO_SPECIFICATION SYPOParameters;
	^
Main.java:89: error: class, interface, or enum expected
	bool SYPO_enabled = FALSE;
	^
Main.java:90: error: class, interface, or enum expected
	int eeprom_new = 0;
	^
Main.java:91: error: class, interface, or enum expected
	int size = 0;
	^
Main.java:92: error: class, interface, or enum expected
	int menu = 1;
	^
Main.java:93: error: class, interface, or enum expected
	u16 u16_TargetVersion;
	^
Main.java:95: error: class, interface, or enum expected
	u8_Port = tcx_DetectComPort(TRUE, &g_st_DevCtl.e_DevType);
	^
Main.java:96: error: class, interface, or enum expected
	itoa(u8_Port, s, 10);
	^
Main.java:97: error: class, interface, or enum expected
	tcx_USBConfig(u8_Port, g_u32_BaudRate);
	^
Main.java:101: error: class, interface, or enum expected
	switch (uMsg)
	^
Main.java:105: error: class, interface, or enum expected
		break;
		^
Main.java:106: error: class, interface, or enum expected
	case WM_CREATE:
	^
Main.java:111: error: class, interface, or enum expected
	case WM_CLOSE:
	^
Main.java:113: error: class, interface, or enum expected
		break;
		^
Main.java:114: error: class, interface, or enum expected
	case WM_COMMAND:
	^
Main.java:120: error: class, interface, or enum expected
				tcx_USBConfig(u8_Port, g_u32_BaudRate);
				^
Main.java:121: error: class, interface, or enum expected
				if (appcmbs_Initialize(NULL, &g_st_DevCtl, &g_st_DevMedia, &pfn_log_buffer_Cb) != CMBS_RC_OK)
				^
Main.java:124: error: class, interface, or enum expected
				}
				^
Main.java:128: error: class, interface, or enum expected
			break;
			^
Main.java:129: error: class, interface, or enum expected
			case IDC_BUTTON2:
			^
Main.java:132: error: class, interface, or enum expected
			break;
			^
Main.java:133: error: class, interface, or enum expected
			case IDC_BUTTON3:
			^
Main.java:135: error: class, interface, or enum expected
				app_HanRegularStart(FALSE);
				^
Main.java:136: error: class, interface, or enum expected
			break;
			^
Main.java:137: error: class, interface, or enum expected
			case IDC_BUTTON4:
			^
Main.java:139: error: class, interface, or enum expected
			break;
			^
Main.java:141: error: class, interface, or enum expected
			default:
			       ^
Main.java:145: error: class, interface, or enum expected
			break;
			^
Main.java:146: error: class, interface, or enum expected
		}
		^
Main.java:149: error: class, interface, or enum expected
	default:
	       ^
Main.java:152: error: class, interface, or enum expected
		break;
		^
Main.java:153: error: class, interface, or enum expected
	}
	^
Main.java:156: error: class, interface, or enum expected
}
^
52 errors
stdout
Standard output is empty