|
LCI wrote: I just want to be able to have that come up towards the top of my dialog application.
As part of the dialog, like a background?
LCI wrote: In addition to this, i would also like to know how to change the MFC logo at the top left to one of my choice .
The easiest way to solve this is to replace the .ico file in the res folder. Then rebuild your project.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
HICON m_hIcon = (HICON)::LoadImage(AfxGetResourceHandle(),
MAKEINTRESOURCE(IDR_XYZ), IMAGE_ICON,
16, 16, 0);
SetIcon (m_hIcon,false);
ModifyStyleEx(0, WS_EX_APPWINDOW);
This is what you can do to set the icon in the bitmap form on the dialog of your application when IDR_XYZ is the id of the icon you wnt to display
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
You can place a static control on your dialog and call SetBitmap() on it (for MFC) or send it the STM_SETIMAGE message (for Win32)
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
yaa Actually that dialo box is created using Resources or Its
Run Time dialog box
krishna
|
|
|
|
|
|
Hi all,
I have a simple question.
I used
::UpdateWindow(m_hWnd); and ::UpdateWindow(::GetParent(m_hWnd));
in my program so i can see the updated control data on window dlg data. It only works during debug but when the program is not running in debug mode, it freeze and I can no longer see the control updates.
May I please know how to fix that problem so I can see updates on the dialog controls/static.
Thanks
|
|
|
|
|
A common problem in release (vs. debug) builds is the use of uninitialized variables (which contain garbage in release mode and zero in debug mode). Check your code for these. If the problem persists, you'll need to post a code snippet (not your entire app!) in order to get more help.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
pnpfriend wrote: I used
::UpdateWindow(m_hWnd); and ::UpdateWindow(::GetParent(m_hWnd));
in my program so i can see the updated control data on window dlg data.
What exactly are you updating? UpdateWindow() updates the client area of the specified window (or control) by sending a WM_PAINT message to it. Is that what you are expecting?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Yes.. I think that I am expecting.
I have static control that keep track of num of files in the loop like 1 2 3 4 5 ..
in debug mode, you can see the num of files: increasing as the loop goes on even you open other windows. If it is not running in debug mode, the increasment still as soon as i touch other windows. It looks like the program is freezed but busy working.
Isn't ::UpdateWindow(m_hWnd) solution to this? What am I doing wrong?
Thanks
|
|
|
|
|
pnpfriend wrote: Isn't ::UpdateWindow(m_hWnd) solution to this?
Not hardly.
pnpfriend wrote: What am I doing wrong?
You need to create two CStatic variables, one for each control. Make sure the DoDataExchange() method is correct:
void CMyDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_STATIC1, m_static1);
DDX_Control(pDX, IDC_STATIC2, m_static2);
} Now when you need to update them, simply call SetWindowText() like:
int nCounter = 1;
CString strCounter;
strCounter.Format("%d", nCounter);
m_static1.SetWindowText(strCounter);
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Yes David.
That's what I have.
It gets updated.. But it is just doesn't show it anymore as soon as after I touch or click or focus on other windows.
The dialog looks like it got frozen. It no longer update any controls on dialog. All the dialog controls become alive or awake again when it gets out from the loop.
I thought inorder to prevent from dialog to get looks frozen, I have to call ::UpdateWindow(m_hWnd) to update or redraw the whole dialog including every controls that I have on dialog.
|
|
|
|
|
pnpfriend wrote: It no longer update any controls on dialog. All the dialog controls become alive or awake again when it gets out from the loop.
That indicates that you're doing the work in the main UI thread. The UI is not going to be responsive as a result. You can use SetWindowText() to update the control immediately if that's the only problem you have, otherwise move the loop to a worker thread.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Thanks
I had changed to worker thread.
it is working.
thanks.
|
|
|
|
|
thanks for your answers.
What I meant is:If there is a simple way like in Visual Basic where you right click at the properties of the button and you can change the back color the color you want.
Is there some thing like this in visual studio C++?
thanks again
|
|
|
|
|
|
There is nothing like what want in VC++,we have to write it
from Scratch.
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
Not in the dialog designer, but you can handle the WM_CTLCOLOR message and set the background colour there.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
|
Hello everyone.
I have a simple question.
How can I give the buttons or forms a color
like in visual basic ?
Thanks in advance !
-- modified at 12:38 Monday 10th April, 2006
|
|
|
|
|
you maight find what you want here[^]...
|
|
|
|
|
Hi hektor kashuri,
I suggestion that you derived CButton and use WM_DRAWITEM
|
|
|
|
|
As others have pointed out, there's no VB-like "background color" property you can set. Instead, you'll need to paint the button yourself. See this[^] article.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
hi there,
i need to send the decimal number "2" as a parameter to a function, but the method passes this parameter as a (u_char *). how can i stop this number from being converted to its ascii value of 50 when passing it through the parameter.
i can't send the ascii value of "2", as this is defined as STX in ascii table.
ian dineen
|
|
|
|
|
"2" is not a number but a C-Style null terminated string (actually, an array of two chars : { '2', '\0' } .
idineen wrote: how can i stop this number from being converted to its ascii value of 50 when passing it through the parameter.
can you show us a piece of the code by which you call the function, and how the function uses this parameter too ??
i'm quite sure you don't use it properly.
|
|
|
|
|
the code below is used to put a snmp object id into a pdu packet along with 3 parameters. the third parameter is used by the program to identify that the paramter is interrupted as a integer. the 4th parameter "test" is the number that i want to pass, this parameter is of type "(u_char *)" and the last is the length of the string.
snmp_pdu_add_variable(pdu, oid, oid_length, ASN_INTEGER , test, strlen(test));//
thanks
ian
|
|
|
|