|
Create a service which monitor your application and call a MessageBox from your service whenever your application is closed.
|
|
|
|
|
Hi,
Try handling the WM_QUIT message in the application main window. Here you show a messagebox using ::MessageBox API with NULL window handle.
case WM_QUIT :
MessageBox(NULL,"Your Message","Your Message Caption",MB_OK);
i think this will help you.
thanks.
Nitheesh
|
|
|
|
|
Or When you want to exit your program you can run other exe file for show it.
|
|
|
|
|
Hello,
If anyone has any idea about compatibility of Detours with WinCE.
Or any study material anyone can suggest regarding this, please let me know.
Thanks in advance.
|
|
|
|
|
Hi all,
i m working on VC++2005, and my application is SDI type.
i split Mainframe in two parts(in columns),at one side i m using a TreeViewCtrl and other side i m using FormView classes,
i m replacing the views on the LButtonDown of TreeViewCtrl.
OnInitialUpdate function is not calling in FormView calss those are using in Replaceviews.
please anyone can tell me what can i do.
Thanks in advance.
|
|
|
|
|
If you look on www.msj.com, there was an article or two by Paul DiLascia that covered replacing views. Even if it takes a while to find, they're all really good reads, and informative.
I'm pretty sure there's an article or two on codeproject also.
Lastly, have a look to see when OnInitialUpdate is called for the first view. If it's done from the create frame code in MFC, and you're doing some mutant manual version, then the bug is *you're* not calling OnInitialUpdate.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
|
Hi,
The OnInitialUpdate is called only when the view is created. So delete the view you want to replace and then recreate it. Now the OnInitialUpdate will work fine.
thanks
Nitheesh
modified on Friday, April 4, 2008 7:57 AM
|
|
|
|
|
ThatsMe. wrote: OnInitialUpdate function is not calling in FormView calss those are using in Replaceviews.
Do you mean to use OnUpdate() instead?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
If it's like the code I remember, he'll be creating CTwoView, then killing COneView - and each time you create a new one, he's making sure its OnInitialUpdate member is called. Brush Pen creation etc.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Iain Clarke wrote: ...killing COneView - and each time you create a new one, he's making sure its OnInitialUpdate member is called.
I did this once, and it did not involve killing and re-creating. I created all of the views up front, and a method of my CSplitterWnd -derived class just activated the correct one, which, in turn, called that view's OnUpdate() method.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I think that depends on how many you need, and if you're switching backwards and forwards between them. You may have a large collection of choices, but only likely to use a few - in which case late creation would be best. I've used each approach on different projects.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Hi all,
I am having a folder and in that folder i am having some file...
Now i have written a code which makes this folder and write files in this particular folder.....
My problem is if folder is existing at that place then a new copy is been created with same name and having same file in previous folder only, where as what i want is to copy new files on previous files....
How to achieve this....
Can anybody please help me in this
Thanks in advance
|
|
|
|
|
You want to replace an existing file with a new one? If yes, show the code that you have written to do the same.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi,
If you are using CreateFile Function[^]Windows API to create the file, then set the 5th parameter(dwCreationDisposition) as OPEN_ALWAYS to create the new file always.
If it is some other function, there will be a flag for setting file creation mode.
Another way is to find the files by using CFileFind functions, delete them by DeleteFile() then create new files.
Post code if you have problem still.
Thanks,
Suman
--
"Programming is an art that fights back!"
modified on Friday, April 4, 2008 8:37 AM
|
|
|
|
|
neha.agarwal27 wrote: ...if folder is existing at that place then a new copy is been created with same name...
This is not possible.
neha.agarwal27 wrote: ...what i want is to copy new files on previous files....
Do you mean overwriting?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
neha.agarwal27 wrote: new copy is been created with same name and having same file in previous folder only
Folder with same name is not possible, Do you mean, the file with same name is created like "Copy of File1" if there is "File1" already or something like that?
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
neha.agarwal27 wrote:
My problem is if folder is existing at that place then a new copy is been created with same name
What the heck? How can it create two folders with the same name?
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
You cant make same folder on that folder but you can use of some character with our name.
|
|
|
|
|
I need some tips on how to find out why this is happening.
I got a workerthread. And when it has added an item to an queue, I post a message to mainframe. (the message has been created with ::RegisterWindowMessage(...) )
using PostMessage( hWndMainFram, MY_MESSAGEID , 0 , 0 );
And in CMainFrame::PreTranslateMessage(...) I trap the message and I pick up the item from the queue, This all work very well. Except in one situation.
If the user are in a menu. If an menu is shown at the same time the postmessage are sent from the workerthread, The message is never recieved in CMainFrame::PreTranslateMessage(...)
Anyone got any ide on how to fix it.
- Mathias S.
|
|
|
|
|
|
I have an MFC Dialog which houses 3 radio buttons.
I want to take some action only when user selects radio button which is not selected already so that I don't perform the same set of actions if a user RE-Selects a radio button.
Can someone advise me what's the best way to achieve this ?
Thanks
Cage
|
|
|
|
|
Hi,
You mean when clicking the same radio button again and again or when selecting a button and change to other again come back to previous button?
In second case, you can set a static variable like static bool bAlreadySelected = true when the button clicked already it will be true. Otherwise perform the set of options.
Set the above variable to false at startup of dialog.
This is one way. There may be some other way too.
Thanks,
Suman
--
"Programming is an art that fights back!"
modified on Friday, April 4, 2008 1:22 AM
|
|
|
|
|
No Suman, that doesnt solve my problem.
I want to take a certain action everytime the control is transferred from the other radio button, not just for the first time.
Let me be more clear. Example -
Three radio buttons be A, B and C.
I want to perform certain operations everytime user has selected A or B and then he clicks C, but I don't want to take any action if user re-selects C.
|
|
|
|
|
That's not very complicated: in your class declare an integer variable (e.g. m_currentSelected). On each of your radio button handler functions, assign a value to this variable (e.g. 1 for the first radio button, 2 for the second, ...).
It is easier with code:
void CMyClass::OnRadio1Clicked()
{
if(m_currentSelected==1)
return;
m_currentSelected = 1;
}
|
|
|
|