BOOL InitInstance (HINSTANCE hInstance, int nCmdShow) { HWND hWnd; TCHAR szTitle[MAX_LOADSTRING]; TCHAR szWindowClass[MAX_LOADSTRING]; hInst = hInstance; /* Init stack */ if (OnInitStack() == FALSE) return FALSE; LoadString (hInstance, IDC_PJSUA_WINCE, szWindowClass, MAX_LOADSTRING); MyRegisterClass (hInstance, szWindowClass); LoadString (hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); hWnd = CreateWindow (szWindowClass, szTitle, WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 200, NULL, NULL, hInstance, NULL); if (!hWnd) { return FALSE; } hMainWnd = hWnd; ShowWindow (hWnd, nCmdShow); UpdateWindow (hWnd); if (hwndCB) CommandBar_Show (hwndCB, TRUE); SetTimer (hMainWnd, ID_POLL_TIMER, 50, NULL); pjsua_detect_nat_type(); return TRUE; }
static void ui_detect_nat_type() { int i = pjsua_detect_nat_type(); if (i != PJ_SUCCESS) pjsua_perror(THIS_FILE, "Error", i); }