|
I think you should add to your form a handler for WM_SIZE message (i.e. OnSize function) and do the adjustments of child controls here.
|
|
|
|
|
Thank you, it works. As in all other resizing dialogs. I don't know, why I've got problems with this. Somehow I thought that my CMDIChildFrame should handle the WM_Size message.
|
|
|
|
|
Hai all,
I have a dialog based programme.
-> I have Created CCustomStatic from CStatic using class wizard.
-> I havent inserted any CStatic Resource.
-> I created my static window in OnInitDialog() of dialogbox
st.Create(_T("my static"), WS_CHILD|WS_VISIBLE|SS_CENTER,CRect(10,10,150,50),this);
-> After this I have added OnEraseBackground() in my CCustomStatic and Wrote the following code
BOOL CCustomStatic::OnEraseBkgnd(CDC* pDC)
{
TRACE("\n ERASE BACKGROUND");
RECT rc;
GetClientRect(&rc);
CBrush brush(RGB(255,0,0));
pDC->FillRect(&rc,&brush);
return TRUE;
}
->But I didnt get a Static with Red Color.
->But Later when I added OnPaint Message Handler in my CCustomStatic class , I got Red colored Static Control.
->Why this is happening So.
->Here What is special with OnPaint() in CCustomStatic
Please Help me
Thanks in Advance
George
|
|
|
|
|
When using standard Win32 API you need to process the WM_CTLCOLORSTATIC message and return a HBRUSH to get a custom background. I don't know if this applies to MFC but hopefully it will give you something to think about.
|
|
|
|
|
Hi Steve,
When I checked in my CCustomStatic Messages
I didnt get WM_CTLCOLORSTATIC
I found WM_CTLCOLOR, and I used it as u said for WM_CTLCOLORSTATIC
And I got my Static control's color changed.
But Still I am doubted with my Onpaint() Magic in CCustomStatic.
Thanks
George
|
|
|
|
|
Write the code/algorithm for function "int* minChangeMac(int cents, int* cDenoms, int* cCounter)"
where minChangeMac converts cents into elements of cDenoms and returns a pointer to an array cCounter such that sum of elements in cCounter array is the minimum possible number.
example 1: if cents = 56 and cDenoms = [25, 10, 5, 1] then cCounter = [2, 0, 1, 1]
example 2: if cents = 31 and cDenoms = [25, 10, 1] then cCounter should be [0, 3, 1] and not [1, 0, 6]
|
|
|
|
|
AryaSoft wrote: Write the code
i generally don't like these kind of question, because they traduce a lazy person asking for other to do it's homework
|
|
|
|
|
You have to give the guy points for being honest, however, that it was an interview question.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
AryaSoft wrote: Challenging Interview Question
do you passed in that interview or not
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
|
You can write your code and if you have any problem then ask
|
|
|
|
|
Sounds like fun, what was your answer ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
How Can I View the Dll file function and return Types or Params types?
thx.
msn:Flashcutreg@hotmail.com
|
|
|
|
|
For exported functions use
dumpbin /exports my.dll
For exported COM-components use oleview and choose "View TypeLib" from File menu.
|
|
|
|
|
Shi Zhu wrote: How Can I View the Dll file function and return Types or Params types?
Depend.exe well help.. this is present in the tool folder of Visual Studio!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
For example, as I have 2 USB keyboard linked to one PC, And I use one of them to press "K" key, and how can i know which one is inputting "K" key.
does any API can do this? Thanks
|
|
|
|
|
No - it's coming from 'the' keyboard, if you have more than one, they are both 'the' keyboard when you press a key on them.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Two keyboards? Why?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
lpy_chl wrote: For example, as I have 2 USB keyboard linked to one PC, And I use one of them to press "K" key, and how can i know which one is inputting "K" key.
does any API can do this? Thanks
this is not possible AFAIK i know... window will present problem~
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
I would like to know how to do the screen capture?
Please help!
|
|
|
|
|
But not enough to search the site ? There's at least two articles on this.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
Hi to All,
I have a problem in VC++.
Im using ado object for database application.
Is there any method exists in _RecordsetPtr to reteive all Column_Names and
Data_types of columns(Fields).
I have tried a lot,but failed.
plz suggest me.....
Thanks a lot in advance
Nagaraju
|
|
|
|
|
This might work, assuming recordset is a _RecordsetPtr:
ADODB::FieldPtr field;
CString name;
int type;
for (int i = 0; i < recordset->Fields->GetCount(); i++ )
{
field = recordset->Fields->GetItem(COleVariant(i));
if (field)
{
name = field->GetName();
type = field->GetType();
}
}
- S
50 cups of coffee and you know it's on!
|
|
|
|