HINSTANCE hinst;
int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR pszCmdLine, int iCmdShow)
{
DialogBox(hinst, MAKEINTRESOURCE(IDD_MAIN), NULL, WndProc);
//printf("Press ENTER to exit...");
//return getchar();
//MessageBox(NULL, "安安", "安安", MB_OK | MB_ICONEXCLAMATION);
//定義窗口類
/*WNDCLASSEX wcx;
HWND hwnd;
//hinst hinstance;
MSG msg;
BOOL fGotMessage;
wcx.lpszClassName = "mainwclass";
wcx.cbSize = sizeof(wcx);
wcx.style = CS_HREDRAW | CS_VREDRAW;
wcx.lpfnWndProc = WndProc;
wcx.cbClsExtra = 0;
wcx.cbWndExtra = 0;
wcx.hInstance = hInst;
wcx.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wcx.hCursor = LoadCursor(NULL, IDC_ARROW);
wcx.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wcx.lpszMenuName = NULL;
wcx.hIconSm = (HICON)LoadImage(hinst,
MAKEINTRESOURCE(5), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CXSMICON),
LR_DEFAULTCOLOR);
if (!RegisterClassEx(&wcx))
{
return 1;
}
//使用窗口類創建窗口
hwnd = CreateWindow("mainwclass",
L"CMBS test",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
(HWND)NULL,
(HMENU)NULL,
hinst,
(LPVOID)NULL);
if (!hwnd)
{
return 1;
}
ShowWindow(hwnd, iCmdShow);
UpdateWindow(hwnd);
while (fGotMessage = GetMessage(&msg, (HWND)NULL, 0, 0) != 0)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;*/
}
HWND textfield;
HWND list;
//窗口過程處理消息
//視窗處理勢丹執行續,如果有呼叫while loop 會造成視窗無法出現
INT_PTR CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
BOOL bRet = TRUE;
int number = 1;
//TCHAR s[10] = L"hello";
u8 u8_Port = 0;
u8 btn4 = 0;
TCHAR s[2] = L"H";
//u8 u8_Port = 0;
char *psz_XMLFile = NULL;
char *psz_LogFile = NULL;
char psz_HostLogFile[100] = { 0 };
char *psz_TraceFile = NULL;
char *psz_EEpromFile = NULL;
char *psz_FirmwareFileName = NULL;
char *psz_ComDevName = NULL;
u8 u8_USB = 0;
bool TDM_Type = 0;
int iPacket = 32;
ST_IE_SYPO_SPECIFICATION SYPOParameters;
bool SYPO_enabled = FALSE;
int eeprom_new = 0;
int size = 0;
int menu = 1;
u16 u16_TargetVersion;
u8_Port = tcx_DetectComPort(TRUE, &g_st_DevCtl.e_DevType);
itoa(u8_Port, s, 10);
tcx_USBConfig(u8_Port, g_u32_BaudRate);
//task();
switch (uMsg)
{
case WM_INITDIALOG:
list = GetDlgItem(hwnd, IDC_LIST1);
break;
case WM_CREATE:
break;
case WM_CLOSE:
EndDialog(hwnd, 0);
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_BUTTON1:
u8_Port = tcx_DetectComPort(TRUE, &g_st_DevCtl.e_DevType);
tcx_USBConfig(u8_Port, g_u32_BaudRate);
if (appcmbs_Initialize(NULL, &g_st_DevCtl, &g_st_DevMedia, &pfn_log_buffer_Cb) != CMBS_RC_OK)
{
CFR_DBG_ERROR("TCX ERROR: !!! Host could not be started up!\n");
}
SetDlgItemText(hwnd,IDC_STATIC2,s);
break;
case IDC_BUTTON2:
app_SrvSubscriptionOpenExt(120, CMBS_HS_REG_ENABLE_ALL);
break;
case IDC_BUTTON3:
MessageBox(hwnd, TEXT("123"), TEXT("123"), MB_OK);
app_HanRegularStart(FALSE);
break;
case IDC_BUTTON4:
btn4 = 1;
break;
default:
DefWindowProc(hwnd, uMsg, wParam, lParam);
break;
}
break;
default:
bRet = FALSE;//must add , if no add, can cash
break;
}
return bRet;
}
SElOU1RBTkNFIGhpbnN0OwoKaW50IEFQSUVOVFJZIFdpb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JCgkJYnJlYWs7CglkZWZhdWx0OgoKCQliUmV0ID0gRkFMU0U7Ly9tdXN0IGFkZCAsIGlmIG5vIGFkZCwgY2FuIGNhc2gKCQlicmVhazsKCX0KCXJldHVybiBiUmV0OwoKfQ==
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