BOOL CMobileOpalDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon if (!m_dlgCommandBar.Create(this) || !m_dlgCommandBar.InsertMenuBar(IDR_MAINFRAME)) { TRACE0("Failed to create CommandBar\n"); EndDialog(IDCANCEL); return FALSE; // fail to create } // Resize to screen width ShowWindow(SW_SHOWMAXIMIZED); // Start background check for OPAL messages SetTimer(TimerID, 100, NULL); // Recent calls list unsigned index = 1; for (;;) { CString key; key.Format(L"%04u", index++); CString uri = AfxGetApp()->GetProfileString(RecentCallsSection, key); if (uri.IsEmpty()) break; m_ctrlCallAddress.AddString(uri); } // Speakerphone state m_speakerphone = false; SetSpeakerMode(m_speakerphone); // Get interfaces CStringArray interfaces; GetNetworkInterfaces(interfaces, false); for (int i = 0; i < interfaces.GetSize(); ++i) { if (!m_localAddress.IsEmpty()) m_localAddress += ", "; m_localAddress += interfaces[i]; } UpdateData(false); SetCallButton(false); return TRUE; // return TRUE unless you set the focus to a control }
BOOL COptionsGeneral::OnInitDialog() { CScrollableDialog::OnInitDialog(); m_interfaceAddressCombo.AddString(L"*"); // Get interfaces CStringArray interfaces; GetNetworkInterfaces(interfaces, true); for (int i = 0; i < interfaces.GetSize(); ++i) { CString iface = interfaces[i]; int percent = iface.Find('%'); if (percent > 0) { AddToCombo(iface.Left(percent)); AddToCombo(iface.Mid(percent)); } AddToCombo(iface); } UpdateData(false); return TRUE; }