I am trying to get a dialogue box to work. It opens but that is it.
When I ran a debugger I put a break in the but it didn't break. It didn't break in a known box either.
Code:
BOOL CALLBACK Atlantis_DlgProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
Atlantis *sts = (uMsg == WM_INITDIALOG ? (Atlantis*)lParam : (Atlantis*)oapiGetDialogContext (hWnd));
// pointer to vessel instance was passed as dialog context
switch (uMsg) {
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDCANCEL:
oapiCloseDialog(hWnd);
return TRUE;
//case IDC_ASCENTAP:
// sts->CreateAscentAPDlg();
// break;
case IDC_PLBAYOP:
sts->plop->OpenDialog();
break;
case IDC_RMSOP:
if (sts->RMSSELECT==1) oapiOpenDialogEx(g_Param.hDLL, IDD_RMS, RMS_DlgProc, 0, sts);
break;
case IDC_LIGHT:
oapiOpenDialogEx(g_Param.hDLL, IDD_LIGHT, LIGHT_DlgProc, 0, sts);
break;
}
break;
}
return oapiDefDialogProc (hWnd, uMsg, wParam, lParam);
}
Code:
BOOL CALLBACK LIGHT_DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
Atlantis *sts = (uMsg == WM_INITDIALOG ? (Atlantis*)lParam : (Atlantis*)oapiGetDialogContext(hWnd));
// pointer to vessel instance was passed as dialog context
const double step = 0.05*RAD;
static double t0;
double t1;
HICON hIcon;
HWND hDlg;
switch (uMsg) {
case WM_INITDIALOG:
return FALSE;
case WM_DESTROY:
KillTimer(hWnd, 1);
return 0;
case WM_TIMER:
if (wParam == 1) {
t1 = oapiGetSimTime();
if (hDlg = oapiFindDialog(g_Param.hDLL, IDD_LIGHT)) {
if (sts->rmslight_status == 1){
SetWindowText(GetDlgItem(hDlg, IDC_FLOODON), "LIGHT ON");
//EnableWindow(GetDlgItem(hDlg, IDC_STOW), TRUE);
}
if (sts->rmslight_status == 0){
SetWindowText(GetDlgItem(hDlg, IDC_FLOODON), "LIGHT OFF");
//EnableWindow(GetDlgItem(hDlgsts->rmslight_status = 0;
}
}
t0 = t1;
}
break;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDCANCEL:
oapiCloseDialog(hWnd);
return TRUE;
break;
}
}
return oapiDefDialogProc(hWnd, uMsg, wParam, lParam);
}
When I ran a debugger I put a break in the but it didn't break. It didn't break in a known box either.