|
Ha ha, yes I did think it should be parent.
Thanks!
|
|
|
|
|
Actually, if it was a typo then why does the diagram underneath refer to "dad" and the dad.reset() ? Surely that can't be a typo as well?
|
|
|
|
|
As I said before - you really should download the sources first. The code will probably clear things up
|
|
|
|
|
Why not post this message on that article rather than here?
Looking at the article, I think that's a typo - dad should be parent
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hmmm, if it was a typo to put "dad" instead of "parent", then is the diagram showing dad pointing to the CDad struct a mistake as well?
|
|
|
|
|
He probably used dad and son or boy throughout, then tried to remove the gender specificness as it could be seen as discriminatory?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hmmm, thats confusing! I'll try and email the author (if thats possible) as it is a good article and I want to get my head round it.
Thanks !
|
|
|
|
|
Hallo i have the following prbolem:
i need to modify the CFont Dialog, and by using this
code got the following Error: Debug Assertion Failed!
Hier is the code:
UpdateData(TRUE); // Debug Assertion Failed
LOGFONT lf;
CFont *pFont = GetFont();// Debug Assertion Failed
pFont->GetLogFont(&lf);
...
Any help would be appriciated thanks in advance.
|
|
|
|
|
You should go deeper with the debugger.
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 already went deeper in the Debugger, i still could not fix the problem.
|
|
|
|
|
Go deeper. Can't you see what assertion is failing?
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 see it but I can't say it to you,its secret.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
My CPMRU 's battery pack is still charging...
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]
|
|
|
|
|
You need to change it.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
You need to modify CFontDialog or CFont? and where do you use of this code?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
in the Test_Doc.cpp file(SDI_Appliction), i use the following code:
void CTest_Doc::OnInputFont()
{
CTestFontDialog sfdlg; // CTestFontDialog is derived from CFontDialog
tfdlg.OnInputFontDialog();
}
and this code is in the OnInputFontDialog()
{
LOGFONT lf;
CFont *pFont = GetFont(); // Fehler
pFont->GetLogFont(&lf);
.........
}
the OnInputFontDialog() is in TestFontDialog.cpp this class is derived from CFontDialog.
How can i see what fail the assertion?
m_hWnd = 0x00000000
maybe this is why?
|
|
|
|
|
Usually GetFont has retuns valid but you dont have any window(m_hWnd=0x0000) so it cant return anything.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
okay how can i have the window? when the ctor of the CFontDilaog is called parameter m_hWnd will be passed as zero, how can solve this?
|
|
|
|
|
Its simple you can create it did you see Create ?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
CTestFontDialog tfdlg;
tfdlg = this->CreateObject();// did not work
tfdlg.Creat(templatename, hWnd); // did not work
|
|
|
|
|
For example you can use like this:
CFontDialog *p=new CFontDialog();
p->Create(...);
...
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
CTestFontDialog *p = (CTestFontDialog*)new CFontDialog(0,256,0,(CWnd*)this); // this is CTest_Doc
could you please explain this parameters in the create function?
p->Create(LPCTSTR lpszTemplateName, CWnd * pParentWnd = 0);
|
|
|
|
|
See here[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
i need to pass the window through this ctor, the create function did not work because i do not have
a dialog in my rc, all what i need to do is to modify the normal font dialog(disable some fields in it).
CTestFontDialog(LPLOGFONT lplfInitial, DWORD dwFlags, CDC* pdcPrinter, CWnd* pParentWnd) :
CFontDialog(lplfInitial, dwFlags, pdcPrinter, pParentWnd)//pParentWnd ???(is this the window of the sdi appliction???)
|
|
|
|
|