Click here to Skip to main content
15,888,022 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Usage of bitset ? Pin
k50549-Jan-19 6:09
mvek50549-Jan-19 6:09 
GeneralRe: Usage of bitset ? Pin
Daniel Pfeffer9-Jan-19 21:38
professionalDaniel Pfeffer9-Jan-19 21:38 
GeneralRe: Usage of bitset ? Pin
Vaclav_10-Jan-19 4:39
Vaclav_10-Jan-19 4:39 
QuestionVC++ 2017 redistributables versions. Pin
Maximilien8-Jan-19 4:21
Maximilien8-Jan-19 4:21 
AnswerRe: VC++ 2017 redistributables versions. Pin
Victor Nijegorodov8-Jan-19 8:43
Victor Nijegorodov8-Jan-19 8:43 
GeneralRe: VC++ 2017 redistributables versions. Pin
Maximilien8-Jan-19 9:01
Maximilien8-Jan-19 9:01 
GeneralRe: VC++ 2017 redistributables versions. Pin
Victor Nijegorodov8-Jan-19 9:03
Victor Nijegorodov8-Jan-19 9:03 
QuestionSubclassing a listcontrol in dialog bar Pin
manoharbalu6-Jan-19 23:48
manoharbalu6-Jan-19 23:48 
I have to display a Customized list control in a dialog bar and update it frequently.
I am subclassing a custom list control in my application using:

m_cLstCtrl.SubclassDlgItem(IDC_LSTCTRL_ALARM,this);

CSysWindow is the dialog bar class and have created in CMainFrm using:
if (!m_SysWnd.Create(this, IDD_DLGBAR_APPBAR, WS_CHILD | WS_VISIBLE | CBRS_GRIPPER |CBRS_FLYBY|CBRS_TOOLTIPS | CBRS_SIZE_DYNAMIC, IDD_DLGBAR_APPBAR))
{
TRACE0("Failed to create DlgBar\n");
return -1; // fail to create
}

void CSysWindow::RecentAlarms()
{
//I am testing my List control using the below code:
m_cLstCtrl.SetColumnHeader(_T("Student ID, 100; Enroll Date, 150; Score, 80, 2"));

for (int i = 0; i < 10; i++)
{
const int IDX = m_cLstCtrl.InsertItem(0, _T(""));
m_cLstCtrl.SetItemText(IDX, 0, "");
m_cLstCtrl.SetItemText(IDX, 1, "testDate");
m_cLstCtrl.SetItemText(IDX, 2, (rand() % 51) + 50);

for (int j = 0; j < 2; j++)
m_cLstCtrl.SetItemImage(IDX, j, rand() % 5); // subitem images

}
}

When I call this function inside a thread, the application crashes by triggering a breakpoint.

void tUpdateAllViews( CMainFrame *pMainFrm )
{
while( 1 )
{
pMainFrm->UpdateAllViews();
pMainFrm->m_SysWnd.RecentAlarms();
Sleep(500);
}
}

void CMainFrame::UpdateAllViews()
{
//It also crashes when I call here as below.
m_SysWnd.RecentAlarms();
}

Whereas when I Call this function inside OnUpdate, its working
void CMainFrame::OnUpdate()
{
// TODO: Add your command handler code here

m_SysWnd.RecentAlarms();
}

which is the proper way to call this function that is in the dialog bar class "m_SysWnd.RecentAlarms();" where to call this function?

Please advice.
AnswerRe: Subclassing a listcontrol in dialog bar Pin
Victor Nijegorodov7-Jan-19 2:12
Victor Nijegorodov7-Jan-19 2:12 
Questionupdating output value with timer and resetting if the timer exceeds a certain time or it has a new input value Pin
crucial19536-Jan-19 14:42
crucial19536-Jan-19 14:42 
SuggestionRe: updating output value with timer and resetting if the timer exceeds a certain time or it has a new input value Pin
David Crow6-Jan-19 14:59
David Crow6-Jan-19 14:59 
AnswerRe: updating output value with timer and resetting if the timer exceeds a certain time or it has a new input value Pin
leon de boer6-Jan-19 16:17
leon de boer6-Jan-19 16:17 
QuestionSeperate source code for the tokens in the compiler c++ Pin
Member 141086114-Jan-19 20:10
Member 141086114-Jan-19 20:10 
AnswerRe: Seperate source code for the tokens in the compiler c++ Pin
Richard MacCutchan4-Jan-19 22:08
mveRichard MacCutchan4-Jan-19 22:08 
AnswerRe: Seperate source code for the tokens in the compiler c++ Pin
jschell5-Jan-19 5:59
jschell5-Jan-19 5:59 
QuestionPostmessage Not Working With WH_GETMESSAGE-MFC Pin
srinivasankrishnaa1-Jan-19 20:11
srinivasankrishnaa1-Jan-19 20:11 
AnswerRe: Postmessage Not Working With WH_GETMESSAGE-MFC Pin
Richard MacCutchan1-Jan-19 22:08
mveRichard MacCutchan1-Jan-19 22:08 
GeneralRe: Postmessage Not Working With WH_GETMESSAGE-MFC Pin
srinivasankrishnaa1-Jan-19 22:25
srinivasankrishnaa1-Jan-19 22:25 
GeneralRe: Postmessage Not Working With WH_GETMESSAGE-MFC Pin
Richard MacCutchan1-Jan-19 23:10
mveRichard MacCutchan1-Jan-19 23:10 
GeneralRe: Postmessage Not Working With WH_GETMESSAGE-MFC Pin
leon de boer2-Jan-19 17:44
leon de boer2-Jan-19 17:44 
QuestionBasic Server/Client TCP/IP Software Examples Pin
Bram van Kampen1-Jan-19 12:26
Bram van Kampen1-Jan-19 12:26 
AnswerRe: Basic Server/Client TCP/IP Software Examples Pin
k50541-Jan-19 19:43
mvek50541-Jan-19 19:43 
AnswerRe: Basic Server/Client TCP/IP Software Examples Pin
leon de boer1-Jan-19 19:17
leon de boer1-Jan-19 19:17 
GeneralRe: Basic Server/Client TCP/IP Software Examples Pin
Bram van Kampen2-Jan-19 13:57
Bram van Kampen2-Jan-19 13:57 
GeneralRe: Basic Server/Client TCP/IP Software Examples Pin
jschell5-Jan-19 6:32
jschell5-Jan-19 6:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.