|
Am I misinterpreting this? I have an MDI View that I do a DestroyWindow() on. I had thought that when I do this, the member of the view being destroyed (pmyView->someVariable) would be cleared (and destroyed) as well.......but MSDN says it doesnt destroy the object. SO after destroyWindow() I can still do:
pMyView->someVariable = 7; ???????s since the object stil exists....
It seems wrong but MSDN says the object doesnt get destroyed. SO then if I wanted the myView to 'reset' I would have to go set its members to zero etc, for a fresh start manually?
Appreciate your help,
ns
|
|
|
|
|
ns wrote:
Am I misinterpreting this?
I think so. The DestroyWindow() call will destroy only the window that is attached to the view object. It does not destroy the view object itself.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
So if I destroyWindowed my View, then later recreated a new window for that same view, the members of that view would retain the values they had before? And I dont have to reasign them?
Appreciate your help,
ns
|
|
|
|
|
You are correct. Not sure what you are trying to accomplish, but keep in mind that the framework usually handles view creation/destruction on your behalf.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
I set an initially false flag to true in my view class onInitialUpdate, then I later destroy the view. After that at some point, it gets created again: using pTemplate->CreateNewFrame. So I was wondering if this newly created view was going to remember what its old flag value is, or if I need to set it to false explicitly (I want it to be false when the window gets recreated....)
Appreciate your help,
ns
|
|
|
|
|
DestroyWindow() destroys the raw window (i.e. the object referenced by a HWND ) that belongs to a CWnd (or derived) object, and not the object itself.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Is it possible to add a hook to keyboard from a services
I want to add the hook when the service is starting and remove the hook when the service is stop.
I tried but the hook can not be installed.
Thanks
Florian
|
|
|
|
|
I create my ACcess database in VC code. THe records get added in somr random unsorted fashion using AddNew(). After I am all done, I want to physically sort this database on one column so that if I look in the database, the records have actually rearranged themselves. WE can do this manually but I am wondering if we can do this in code. If I do a select *, order by, that returns a "virtual" recordset where the indices of the files in it do not match the indices of the files in the actual databse. Any suggestions?
Appreciate your help,
ns
|
|
|
|
|
If I make a static object of class A a (public) member of class B, how can I use the member functions of class A implicitly? Without having to do A.Function() all the time? Is this possible? The same for variables, I don't want to keep doing A.Var .
Obseve everything, remember more...
|
|
|
|
|
If I understand you correctly, you have a member variable of type A in class B.
You now add code to class B , and want this code to access member function of class A, right?
You then have to give the scope of the call (i.e. writing m_var.function() ).
Maybe what you want is derivation? You then can call the base class implicity.
But beware: deriving B from a models a 'is a' relationship. i.e. your green coloured dialog is a CDialog. Look if that is true with your problem.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Thanks, I'll give that a try.
Obseve everything, remember more...
|
|
|
|
|
Hi:
I want to rewrite the drawing method of the buttons on the toolbar,so I use NM_CUSTOMDRAW to do so.but on the OnCustonDraw function , the state of the buttons are always 0 or CDIS_HOT ,and will never be CDIS_SELECTED, why ?how can I know if the button is pressed ?
thanks
benben
|
|
|
|
|
I have a normal CDocument / CView application (VC6 SP5) which generally works very well. But if it is running with Windows XP I got severall times this error message: "Can not save unamed file" when I try to save a file. I have never seen this error before. Then there is also a file "mfc2e.tmp" in the folder where the file should be saved.
The file "mfc2e.tmp" contains the contens of the desired file.
The filename "mfc2e.tmp" seems to be the result of an tmpnam(),
but I didnt find any hint in the MFC sources.
bb |~ bb
|
|
|
|
|
Harald Krause wrote:
"Can not save unamed file"
I sometimes see a MessageBox "There is an unknown error in an unnamed file " in my application. And no, I am not generating it myself...;P
I feel this is the second best error message right after the famous message box with nothing in it.
This error seems to be connected with my application opening a temp-file while being a restricted user or the TEMP variable pointing to nowhere.
I would like to hear from your experience with this mysterious errors.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Nothing mysterious is happening in MFC. You have all the sources of the library and even it isn't a peace of cake, but you always can find the reason of unexpected message box.
|
|
|
|
|
Does anyone can tell me how to active the screensaver programmatically on MS Windows platform?
|
|
|
|
|
You can use
<br />
SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT,1,0,SPIF_SENDWININICHANGE);<br />
to change the screensaver timeout thus triggering it after one second. Setting the timout to zero does not seem to work, so you'll have a minimum delay of one second.
Don't forget to change the timeout back to a normal value when you're done
|
|
|
|
|
Anybody help me how to create emoticons window, just like MSN Messenger did.
Please help me in this regard
Thanks
Phantom
|
|
|
|
|
You have to create one by yourself, since there's no thing like a standard control for it. So you'll have to create your own source for it to handle everything like drawing etc.
|
|
|
|
|
Hello,
I am developing a dialog based application. It has a RichEdit Control. I derived it from RichEdit20A. Now all the properties have been closed. I apply all the properties by modifying the .RC file.
Now I do want to wrap the data, when it exceeds the RichEdit20A width. I also unselects the AutoHScroll, so that the data wraps, but it won't work any more.
Please anybody helps me in this regard
Phantom.
|
|
|
|
|
Hi,
I have a hook set up with WH_GETMESSAGE and messages are sent to my hook procedure. But I am not getting WM_NOTIFY. I have clicked on ListView items, renamed then and I still do not get the WM_NOTIFY. Is there a reason for this
|
|
|
|
|
How do you call SetWindowsHookEx, with what parameters?
Regards,
Vitaly Tomilov
Professional tooltips for all development platforms Free on www.Tooltips.NET
|
|
|
|
|
hhGlobal = SetWindowsHookEx(WH_GETMESSAGE,ProcessMessage,hMod,0);
hhGlobal is in a shared data segment and hMod is the DLL's hInstance
Ceri
|
|
|
|
|
Interesting,
But could you instead use WH_CALLWNDPROC and see how it works?
Apparently, WM_NOTIFY is posted to a message queue, or posted in a specific way.
Regards,
Vitaly Tomilov
Professional tooltips for all development platforms Free on www.Tooltips.NET
|
|
|
|
|
Hi,
I did try that but everything kept on crashing. Supose I will have to look into WH_CALLWNDPROC a little further
Ceri
|
|
|
|