|
Please make yourself your homework.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I'm certain BOOST already have a template for that.
boost::homework< cash_system >
|
|
|
|
|
Are you sure you can get answer to this question?
|
|
|
|
|
I can't see a question. Anyway, be a good boy and do your own homework.
"It is better to remain silent and be thought a fool, than to open your mouth and remove all doubt."
--Groucho Marx
|
|
|
|
|
Use excel...
Or even better... use the CListCtrl...
Or even better... do your homework...
|
|
|
|
|
U come early in the morning 5 'o' clock
|
|
|
|
|
Ye-ah, sure. - you wanna give me your student ID and the place of submission, so I can save you from doing any work at all. You poor, poor creature.
How far have you made it on your own? Did you get as far as Start->AllPrograms->InsertGroupNameOfCompilerOfChoice->ShortcutToIDEofChosenCompiler?
Just break down the problem into bite sized chunks and solve them one by one.
Please reply urgently asap with your progress. I'd just love hate to be unable to help somebody facing such a dilemma.
Go on - 1 rate me too, I dares ya!
|
|
|
|
|
Ask this guy.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
I want to change the background colour of CStatic box.
The CStatic Box is on a CMDIChildWnd and not on a dialog.
I tried by calling GetDC() of CStatic and then call SetBkColour().But it seems the DC handle is not got properly with GetDC().
But CStatic->SetFont() works properly.
If I want to change the background colour Why the windows static styles don't work while creating the CStatic windows (i.e SS_BLACKRECT, SS_WHITERECT etc)
Regards
Pritha
|
|
|
|
|
You might want to check out the WM_CTLCOLORSTATIC message.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Maybe see here[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello,
Still the background colour has not changed .I really don't understand how can an easy task of changing colours can be so difficult.Please take a look at my class and suggest me the possible errors. Sorry for the trouble.
My class is like this.
Class TableFrame : public CMDIChildWnd
{
Public :
Void PrintHeading();
Private :
Vector<CStatic*> Heading;
Protected :
afx_msg LRESULT ONCTLCOLORSTATIC(WPARAM wParam,LPARAM lParam);
};
BEGIN_MESSAGE_MAP(TableFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(TableFrame)
ON_MESSAGE(WM_CTLCOLORSTATIC, ONCTLCOLORSTATIC)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
Void TableFrame ::PrintHeading()
{
int x=0;
CFont* m_pFont;
LOGFONT LogFont;
memset(&LogFont, 0x00, sizeof(LogFont));
strcpy(LogFont.lfFaceName, _T("MS Sans Serif"));
LogFont.lfHeight = 12;
m_pFont = new CFont;
m_pFont->CreateFontIndirect(&LogFont);
SetFont(m_pFont);
for(int i=0;i<m_TableDoc.GetmDataFields().size();++i)
{
CStatic* Static = new CStatic;
CString String = ColumnHead[i];
x = i*(COLUMNSPACE + 100);
CRect Rect(x,0,x+100,20);
Static->Create(String, WS_VISIBLE, Rect, this,i);
Heading.push_back(Static);
}
}
LRESULT TableFrame::ONCTLCOLORSTATIC(WPARAM wParam, LPARAM lParam)
{
HDC hDC = (HDC)wParam;
::SetTextColor(hDC, RGB(0x00,0x00,0xFF)); // text color bright blue
::SetBkColor(hDC, RGB(0xFF,0x00,0x00)); // text background color
return (LPARAM)(HBRUSH)hbr; // control background
}
Regards
Thanks
Pritha
|
|
|
|
|
prithaa wrote: ::SetBkColor(hDC, RGB(0xFF,0x00,0x00)); // text background color
return (LPARAM)(HBRUSH)hbr; // control background
}
Is hbr brush is properly initialised and lifetime of the object is valid?
if you want the background of CStatic and Text Background same then set the text background to transparent mode
::SetBkMode(hDC, TRANSPARENT); // SetBkColor(hDC, ...
|
|
|
|
|
Does your ONCTLCOLORSTATIC() get called?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
Thanks for your replies.
The ONCTLCOLORSTATIC()was not called when I debugged.
How do I call it?
Regards,
Pritha
|
|
|
|
|
prithaa wrote: How do I call it?
You don't. It gets called by the framework.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
for eg if i give 3 it has to generate binary states in sorting order in terms of no of 1's
|
|
|
|
|
If I understand your question correctly, see here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Nice link, thanks
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
I got the following inline assembly code.
__asm {
MOV ECX, 0E2h
RDMSR
AND AX, 0BFF7h
WRMSR
} I have to port this to x64 code which does not allow inline assembly. What intrinsic functions should I use? Thanks!
Maxwell Chen
|
|
|
|
|
|
Rajkumar R wrote: rdmsr instruction[^] wrmsr instruction[^]
Do you mean that I won't need to worry about the MOV ECX and AND AX instructions? And __rdmsr and __wrmsr do that for me?
What about the size in x64?
In my original code (x86), does it only write back 16 bits (AX )? Or the whole EAX (32 bits)?
With __wrmsr , it writes 64 bits at a time?! Should I take care of anything in addition?
Maxwell Chen
|
|
|
|
|
"For more information, see the AMD documentation" from msdn
I was quickly seeing some documents I cannot find the MSR index equals E2h.
AFAIU, Three registers affects ECX, EAX, EDX.
The contents of ECX selects the MSR to be addressed by the
RDMSR and WRMSR instruction. The EDX and EAX registers contain the MSR values to be read or written; EDX—Upper 32 bits of MSR, EAX—Lower 32 bits of MSR. All MSRs are 64 bits wide. reference[^]
It seems valid fields in EAX for each MSR differs and you need to refer specifications, may be in your orginal code 16bit AX is masked and written back depends on the MSR on index E2h, I think intrinsic functions reads/writes the complete 64bit you need to take care it. I cannot comment more as i don't use .
|
|
|
|
|
Thanks for your great explanations! And please also refer to my reply to Mike (LINK[^]).
Maxwell Chen
|
|
|
|
|
Your original code always reads the whole 64-bit MSR into EDX:EAX and writes EDX:EAX into the 64-bit MSR. There are no partial reads and writes.
I don't know what you were trying to achieve with the original code, though, as there is no 0E2h model-specific register on Intel processors.
A literal translation would be
__int64 val = __rdmsr(0xe2);
val &= 0xBFF7;
__writemsr(0xe2, val); That will work on both x86 and x64 processors.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|