|
Herboren wrote: sweet
home Alabama?
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
[My articles]
|
|
|
|
|
I made this codes on OnPaint() function:
CPaintDC dc(pdlg);
CFont font;
font.CreateFont(
24,
0,
0,
0,
FW_HEAVY,
true,
true,
0,
DEFAULT_CHARSET,
OUT_DEVICE_PRECIS,
CLIP_DEFAULT_PRECIS,
PROOF_QUALITY ,
FF_SCRIPT ,
"Times New Roman");
dc.TextOut(15, 100, "welcome", 7);
dc.SelectObject(&font);
font.DeleteObject();
Text is appear on dialog form, but it is still on regular style and using arial font type.
Whereas, I have set that font to Italic-underline style. I also changed font facename to Times New Roman and Verdana, but there is no differences when it show on dialog form.
What's wrong with my codes? Is there any missing code?
Help me please...
Thanks and Regards,
modified on Monday, September 28, 2009 2:56 AM
|
|
|
|
|
Try putting the line dc.SelectObject before the line dc.TextOut .
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
thank you <<_Superman_>>...
My problem is solved...
Thanks a lot..
|
|
|
|
|
Your problem may be solved, but you may have made another one.
You are keeping the return value of SelectObject, and Selecting it back in later on aren't you?
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi all,
Please help me, how to change color and font of push button in visual C++ 6.0?
Any reference that I can learn?
I used dialog based project.
thanks and regards,
|
|
|
|
|
|
I have tried using this codes:
HBRUSH CGambarDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if( pWnd->GetDlgCtrlID() == IDC_BUTTON1 )
{
pDC->SetBkColor( RGB( 255, 0, 0 ));
pDC->SetBkMode( TRANSPARENT );
}
return hbr;
}
but, nothing changes happened...
that codes is not correct?
|
|
|
|
|
If you read the remarks section of the document, it says that button with certain styles always use the default colors. In such cases, you would need an owner draw button.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thank you for your answers.
Sorry if I confiscating your time. But, I still confuse.
I have read the documents and link to using button on MSDN when I clicked owner-drawn button.
Is it right that these changes possible to do if I use it on Win32App project, not a MFCApp(.exe)?
I have no idea, where I should used this message (WM_CTLCOLORBTN) in Dialog Based Project.
I looked for WM_CTLCOLOR on parent window, I just found OnCtlColor(^).
Please give me explanations.
Thanks a lot.
|
|
|
|
|
Eka Candra wrote: Is it right that these changes possible to do if I use it on Win32App project, not a MFCApp(.exe)?
Of course.
Eka Candra wrote: I looked for WM_CTLCOLOR on parent window, I just found OnCtlColor.
MFC maps the OnCtlColor method to the WM_CTLCOLOR message.
So you just need to write your code into the OnCtlColor method.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Eka Candra wrote: but, nothing changes happened...
Is OnCtlColor() called?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
?????????
WM_CTLCOLORBTN has never been for buttons !
Use either OD button or Undocumented Shell buttons.
|
|
|
|
|
Hi there
I want to create a modeless dialog but have it act like a child window (never gets out of my client area, moves with my window, etc) of a MDI Frame window. The dialogs must stay within the MDIClientWnd of the main frame.
I need to create several children like that all based on different dialog templates.
So, I dont want to use CFormViews as I will have to create several documents and children frames.
Any suggestions?
THanxx guys
NAngelGr
|
|
|
|
|
I believe creating documents and views will be easier and more straight forward than what you're trying to do here.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I agreed with u, and the CFormView is a plus.
|
|
|
|
|
Hi,
I am looking for an experienced DirectX 10 programmer who could be able to create code for terrain, water and the sky. A team of programmers have already built the foundation of the game as now we just need to start working with DirectX.
Thanks
Andrew McIntyre
|
|
|
|
|
This is a forum for technical questions. If you need to advertise, then please use the proper channels; even though it may cost you money.
Please read and abide by these guidelines[^].
|
|
|
|
|
MrMcIntyre wrote: I am looking for an experienced DirectX 10 programmer
And I need a cup of coffee.
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
[My articles]
|
|
|
|
|
So could someone please help me. The reason why I posted it in the C++ section because I could not find the DirectX message boards.
Thanks
Andrew McIntyre
|
|
|
|
|
You actually don't need a DirectX forum. If you need to post a job advertising, there is a Job Board [^] (however you have to pay for). There's even a Collaboration / Testing [^] one.
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
[My articles]
|
|
|
|
|
I just need someone maybe on here to help me with the DirectX or someone could point me to a website where I can post a job advertisement for FREE.
Andrew McIntyre
|
|
|
|
|
MrMcIntyre wrote: I just need someone maybe on here to help me with the DirectX or someone could point me to a website where I can post a job advertisement for FREE.
You may try the Collaboration/Testing forum (I've already given you the link).
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
[My articles]
|
|
|
|
|
Suppose I have a parent class CParent. Suppose I have two other classes, CChildA and CChildB, which both inherit from CParent. Suppose I need to load two instances in memory, but other application conditions affect whether I'm working with CChildA or CChildB. This is obviously do-able with polymorphism like this:
CParent *pChildX = 0, *pChildY = 0;
At some point later I can make the appropriate assignments according to my application conditions:
pChildX = new CChildA();
pChildY = new CChildB();
My question is, what happens when run this code:
delete pChildX;
delete pChildY;
Is the child object fully deleted? I think it would, but it I'm confusing myself by thinking somehow only the CParent component of the data would be deleted, and that there would be a memory leak since the "delete" was not called on explicit CChildA or CChildB variables.
Please someone tell me I'm overthinking this.
|
|
|
|
|
Never mind. I just answered my own question. The answer is my application has memory leaks coming out of my ears. I just found an article that explains you need the keyword "virtual" in your destructor declaration. I haven't been doing that. Shame, shame, shame!
In case anyone else finds it useful, here's the link to the article.
|
|
|
|