Look again at the line Ali was referring to. It's not got syntax issues.
conditioned our mind to see certain patterns. It's easy to miss these sorts
of syntax errors because we're not used to seeing them. The brain sees the
there. Buggy Brains!
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
See below...
On Wed, 15 Oct 2008 11:04:03 -0500, "AliR \(VC++ MVP\)"
<AliR@online.nospam> wrote:
first thing first, you can't call GetDlgItem on id IDC_STATIC. All static
controls on a dialog are by default given IDC_STATIC. If you want to
programmatically change things with the static control, you have to give
it
a different ID. IDC_XXXX
****
I missed the IDC_STATIC. Sigh.
****
Why aren't you simply using a Picture control?
****
That's where the problem arises. A picture control with a Bitmap style
should work. A
generic CStatic probably won't
****
I'm still trying to wrap my head around your ModifyStyle call! Does that
compile?
****
Actually it makes perfect sense, in that the OP is indicating that all
bits should be
cleared and some bits set. Other than the fact that this will have zero
net effect
because it is far too late, it could work, but it is a really, really bad
way to get the
desired effect of setting only some bits (and leaving everything else
untouched).
The line should disappear.
joe
****
AliR.
"Gurikar" <msgurikar@gmail.com> wrote in message
news:d6cc0324-71e9-42e0-87cc-2f1a4745f7c8@r15g2000prh.googlegroups.com...
HI ,
I have created one dialog application, in that i have added one
CStatic control.
Then i have added below code in OnInitDialog()
// Start
CStatic *pStaPicHolder = (CStatic*)GetDlgItem(IDC_STATIC);
if (NULL == pStaPicHolder)
return;
BOOL b = pStaPicHolder->ModifyStyle(~0, (DWORD)(SS_BITMAP, WS_CHILD |
WS_VISIBLE));
//pHBitmap = LoadBitmap(theApp.GetResModuleHandle(),
MAKEINTRESOURCE(nBitmapID));
HBITMAP pHBitmap1 = (HBITMAP)LoadImage(AfxGetInstanceHandle(),
"BallaStream.Bmp", IMAGE_BITMAP, 90, 30, LR_LOADFROMFILE);
if (NULL != pHBitmap1)
{
HBITMAP pBt = pStaPicHolder->SetBitmap(pHBitmap1);
}
//End
But iam not seeing bitmap getting displayed in static control in
dialog.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm