|
Hi all
I am using a multidoc multiview application.In that one view(CGraphView) i am opening and depending upon certain condition(when the user change the time period) i have to close it and open it with respect to the new time selected.
After or before closing this view i need to free up the resources because when the view is again opened exception is generated as there is limited area in the heap.
I am closing the Graph as follows.
CMDIChildWnd* wnd1 = MDIGetActive();
wnd1->MDIDestroy();
Is there is any function to free up all the resources allocated for this view like when a window is closed it automatically frees the memory allocated for it.
|
|
|
|
|
if Class destucter is of any help?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi guys,
I have 2 classes:
class A{
virtual void Paint() {...}
}
class B: public A{
virtual void Paint() {...}
}
Is it possible and what I have to do, so in B.Paint to invoke A.Paint and then some other code
|
|
|
|
|
akirilov wrote: so in B.Paint to invoke A.Paint and then some other code
Yes:
void B::Paint()
{
A::Paint();
}
|
|
|
|
|
akirilov wrote: in B.Paint to invoke A.Paint and then some other code
Implement B::Paint like this:
void B::Paint()
{
A::Paint();
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
class A{
virtual void Paint() {...}
}
class B: public A{
virtual void Paint()
{
A::Paint();
...
}
}
You can also use __super (if available) like:
class B: public A{
virtual void Paint()
{
__super::Paint();
...
}
}
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Thank you guys, the answer of all of you was very helpful.
I tried with A.Paint(), but it didn't work.
I'm going to use __super, thus It will not depend of the base class name.
THANK YOU, again!!!
|
|
|
|
|
akirilov wrote: I tried with A.Paint(), but it didn't work.
Possibly because they suggested A<big>::</big>Paint() instead.
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]
|
|
|
|
|
Well I tried A.Paint() before I posted here
so, A::Paint() is working fine.
|
|
|
|
|
akirilov wrote: I'm going to use __super, thus It will not depend of the base class name.
But it does tie you to Microsoft's compiler...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Along with other answers, see the __super[^] keyword. You could call a parent class function by __super::FuncName()
[EDIT] OK, I just read you already are going to settle on this keyword. [/EDIT]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
hi guys..i have a program that require me to input user input by textbox and output it to a label...but my superviosr wants me to do it on silabs...this means i have to use serial comm to link it...i know the serial comm coding..now i need to know how to output the user input to the label..i try printf(""); and "label1->text= " but it doesnt work..any helps?
|
|
|
|
|
Are you using MFC ? If yes you have to provide a specific Id to your static control in the resource editor. Then you can do something like this (in your dialog class):
GetDlgItem(ID_YOURID)->SetWindowText(_T("Your text here"));
|
|
|
|
|
ruthlesspker wrote: hi guys..i have a program that require me to input user input by textbox and output it to a label...but my superviosr wants me to do it on silabs...this means i have to use serial comm to link it...i know the serial comm coding..now i need to know how to output the user input to the label..i try printf(""); and "label1->text= " but it doesnt work..any helps?
How is it related to the microcontroller?
ruthlesspker wrote: hi guys..i have a program that require me to input user input by textbox and output it to a label...but my superviosr wants me to do it on silabs...
How is it related to the serial communication?
Could you please state more clearly what do you need to do (have you to send the text of an edit box to the microcontroller via the serial port? Should it be formatted in a special way?)?
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]
|
|
|
|
|
Hi,
I have a list view (Report) with 5 colom, I am using a context menu on clicking on any of the row, but the same context menu is also coming for clicking any of the colom.
How can I prevent it to appear on colom?
|
|
|
|
|
I supose you are handling the NM_CLICK or NM_RCLICK notification messages for that, with these you get a NMLISTVIEW[^] structure as parameter, right? I belive in this struct iItem should be -1 if the user did not click on a row.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
You get a different structure, but the idea is the same.
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
I am Handling WM_CONTEXTMENU
|
|
|
|
|
Then handle NM_RCLICK instead, as I described.
Alternatively, you can use CTreeCtrl::HitTest to get the item under the mouse, but that's more work.
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
|
Well, that headers for a list view aren't non-client area - that's like the borders and title bars of your applications.
If you right click (I assume right?), then you get a NM_RCLICK notification. When a list view sends it, you also get a pointer to a NMITEMACTIVATE structure. Looking at that structure, you have a iSubItem member - which is the column number.
Try it, and see for yourself. What if gives you when you click on a header, I don't know.
NM_CLICK gives you the same information on a left click - but it would be a bit unusual for a left click to bring up a menu.
Hope that helps,
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Iain Clarke wrote: NM_CLICK gives you the same information on a left click - but it would be a bit unusual for a left click to bring up a menu.
It certainly wouldn't be the most unusual thing ever seen on this forum...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Stuart Dootson wrote: It certainly wouldn't be the most unusual thing ever seen on this forum...
Talking of which... I haven't seen Carlo yet!
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Still wounded Sir, still wounded, indeed...
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]
|
|
|
|
|
hi,
i want to EXPAND/COLLAPSE an COLLAPSE/EXPAND item when i single-click an item。
and the TVS_SINGLEEXPAND style causes the item being selected to expand and the item being unselected to collapse,but i still want the unselected to keep the old state.
now, i map the NM_CLICK:
<br />
void CTreeControlDlg::OnClickTree1(NMHDR* pNMHDR, LRESULT* pResult) <br />
{<br />
TRACE("OnClickTree1!\n");<br />
<br />
HTREEITEM hItem = m_treeCtrl.GetSelectedItem();<br />
if ( (hItem != NULL) && m_treeCtrl.ItemHasChildren(hItem))<br />
{<br />
...
}<br />
*pResult = 0;<br />
}<br />
thank u very much!!!
|
|
|
|