When I try and change the picture control bitmap using the commands below nothing happens. What am I doing wrong?
pStatic-> ModifyStyle(0, SS_BITMAP);
pStatic-> SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BITMAP2)));
Here is the the code segment with the calls.
void CHebrewDlg::OnBnClickedNext()
{
CEdit *pCtrl = (CEdit*) GetDlgItem(IDC_EDIT1);
CButton *pNormal = (CButton*) GetDlgItem(IDC_RADIO1);
CButton *pRandom = (CButton*) GetDlgItem(IDC_RADIO2);
CStatic *pStatic = (CStatic*) GetDlgItem(IDC_STATIC);
int static count = 0;
int random_count = 0;
wchar_t hebrew_ch[30] = { L'א', L'בּ', L'ב', L'ג', L'ד', L'ה', L'ו', L'ז', L'ח', L'ט',
L'י', L'כּ', L'כ', L'ל', L'מ', L'נ', L'ס', L'ע', L'פּ', L'פ',
L'צ', L'ק', L'ר', L'שׁ', L'שׂ', L'ת' };
pStatic-> ModifyStyle(0, SS_BITMAP);
pStatic-> SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BITMAP2)));
if((pNormal->GetCheck()) == 1)
{
pCtrl->SetWindowTextW((CString)hebrew_ch[count]);
count = ++count % 26;
}
else
{
random_count = (rand() % 26);
pCtrl->SetWindowTextW((CString)hebrew_ch[random_count]);
}
}
[edit]Code block added, "Treat my content as plain text..." option disabled, Tags - OriginalGriff[/edit]