|
-
April 13th, 2007, 05:51 AM
#1
Design questions
I have a dialog based application that has two property pages over it. The property page has a list control, basically the app is a softphone and the list control shows the active calls and it's status. All call handling (making calls, recieving calls, etc) is done by a singleton class and I made another singleton class called CUIManager to update the status of the listbox, statusbar, etc. CUIManager holds a pointer to the list control and I make updates through it. When a call comes in, I start a thread and call the related function in my CCallManager singleton class, CCallManager then calls functions in CUIManager to update the status bar, list control, etc.
Code:
//CPropertyPage derived CCallsPage for showing active calls
BOOL CCallsPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
CUIManager::GetInstance ().m_pList = &m_List;
...
}
//This is how I make updates
void CUIManager::SetCallStatus (int nItem, COLOUMN col, CString strMessage)
{
m_pList->SetItemText (nItem, col, strMessage);
}
Now my question to you people is that, is there a better way of doing all this? I'm using quite a few singletons, so does it mean that the design is poor (excess of everything is bad, I guess)?
Another question that I had is, there is a statusbar in my main dialog which shows messages and all. For now I use a timer to set the text of it to default after certain time. Is there any better way of doing this?
Please share your views with me.
Thanks.
"I rather not play football than wear Nerrazzuri shirt" - Paolo Maldini
FORZA MILAN!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|