|
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???)
|
|
|
|
|
|
susanne1 wrote: void CTest_Doc::OnInputFont()
{
CTestFontDialog sfdlg; // CTestFontDialog is derived from CFontDialog
tfdlg.OnInputFontDialog();
}
The variable sfdlg is not being used. Is this intentional?
"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
|
|
|
|
|
sorry it is type error the variable is an object of CTestFontDialog.
All what i need is to use a modified CFontDialog which has font, font style, and size fields this modified font dialog should be called from an sdi application (Class edit view).
|
|
|
|
|
Why are you not doing something like:
CFontDialog dlg;
if (dlg.DoModal() == IDOK)
{
LOGFONT lf;
dlg.GetCurrentFont(&lf);
CString strFontName = dlg.GetFaceName();
CString strStyleName = dlg.GetStyleName();
int nSize = dlg.GetSize();
...
}
"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
|
|
|
|
|
that is okay but the dialog should have less elements that the original CFontDialog, it should have
Font, font style and font size drop down menu. How can i blind out the other drop down menus?
|
|
|
|
|
susanne1 wrote: How can i blind out the other drop down menus?
Start here.
"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
|
|
|
|
|
What line of what file is asserting (hint: what you've shown is not it)?
"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
|
|
|
|
|
|
Have you looked at that line? What version of VS are you using?
"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
modified on Friday, May 8, 2009 3:47 PM
|
|
|
|
|
hi all
I am writing a application in which i use the stl list. through this list i m able to inserting the items but not able to remove the item from specific position. this is my class
class ClipEntry
{
public:
//CoInitialize(NULL);
ClipEntry();
ClipEntry(const ClipEntry& r);
~ClipEntry();
const ClipEntry& operator=(const ClipEntry& r);
bool operator == (const ClipEntry& r);
private:
IGraphBuilder *m_pGraph;
IUnknown *m_pSinkFilter;
string m_strName;
REFERENCE_TIME m_tOffset;
REFERENCE_TIME m_tStart;
REFERENCE_TIME m_tStop;
// rewound ready to re-use
bool m_bPrimed;
};
I am inserting the items like this
HRESULT ClipPlayer::AddClip(char* path, ClipEntry** ppClip)
{
list<ClipEntry>::iterator it;
it = m_Clips.insert(m_Clips.end(), ClipEntry());
ClipEntry *pClip = &(*it);
*ppClip = pClip;
.........
}
but when i write the remove function like this
void ClipPlayer::RemoveClip(ClipEntry *pClip)
{
m_Clips.erase(&pClip);
// find(m_Clips.begin(),m_Clips.end(),pClip);
}
i am getting error
Could not find a match for 'list<ClipEntry,allocator<ClipEntry> >::erase(ClipEntry * *)'
how i solve this problem
|
|
|
|
|
raj1576 wrote:
list<ClipEntry>::iterator it;
...
void ClipPlayer::RemoveClip(ClipEntry *pClip)
{
m_Clips.erase(&pClip); i am getting error
Could not find a match for 'list<ClipEntry,allocator<ClipEntry> >::erase(ClipEntry * *)'
It seems like you're mixing up what type you're storing in the list...
You don't include the declaration for the m_Clips member variable.
Does it store ClipEntry or ClipEntry* ?
The compiler error a probably caused by the fact that std::list::erase()
expects an iterator as argument and not a pointer to an element in the list.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
so how i pass this argumet in the erase()?
i am getting the whole value of the list in the ClipEntry *pClip which i want to remove.
RemoveClip(ClipEntry *pClip)
|
|
|
|