|
infonaut wrote: I wish to launch an external application [TTools.exe] from within my simple win32 console app.
Search for CreateProcess at CodeProject!
|
|
|
|
|
|
Thanks Mike & Sceptic
|
|
|
|
|
Hello,
I have created a SDI with CFormView as the view (VC++6). I would like to add some code to do something when the 'X' button of the document is pressed.
In a Dialog box we process the WM_CLOSE message.
Please can you tell me how to do it in a SDI document?
Thanks.
Fortitudine Vincimus!
|
|
|
|
|
Process the WM_SYSCOMMAND[^] notification; look for wParam set to SC_CLOSE .
Software Zen: delete this;
|
|
|
|
|
Thank you for your reply.
I tried to process the WM_SYSCOMMAND in MyAppDoc.cpp and then in MyAppView.cpp, but it is not working. The command is not even listed in the class wizard.
What do i do?
Fortitudine Vincimus!
|
|
|
|
|
You'll need to add an OnSysCommand() [^] handler to your view class, and look for the nID value to be set to SC_CLOSE . If you're writing an SDI application, you can also process this command in your CFrameWnd -derived[^] class.
Software Zen: delete this;
|
|
|
|
|
The view is a CFormView. Would that be any problem.
I added OnSysCommand() in my CFomView class. I put a message box there. But it seems like the control just does not go there. Sigh!!
Fortitudine Vincimus!
|
|
|
|
|
The 'X' button is on the frame window not the form window. Try handling it in the frame window
class instead.
Mark
|
|
|
|
|
I added the WM_CLOSE command in my MainFrame class.
But now the problem is that I am not able to retrive data from the input boxes of my CMyFormView.
The program Asserts when GetWindowText is called.
void CMainFrame::OnClose()
{
CMyFormView pFV;
pFV.OnAppExit();
CFrameWnd::OnClose();
}
<p\ pre="">
<div class="ForumSig"><hr><font color="brown">Fortitudine Vincimus!</font></div>
|
|
|
|
|
How about this...
void CMainFrame::OnClose()
{
CMyFormView *pFV = (CMyFormView *)GetActiveView();
pFV->OnAppExit();
CFrameWnd::OnClose();
}
|
|
|
|
|
Yipee!! It worked!! Thanks a billion!!
GetActiveView() - so thats the way. Create an object of the view and then set the focus on it.
Thank you once again.
Fortitudine Vincimus!
|
|
|
|
|
Tara14 wrote: Yipee!! It worked!! Thanks a billion!!
Cool!
Tara14 wrote: GetActiveView() - so thats the way. Create an object of the view and then set the focus on it.
The view object already existed. You just needed a pointer to the one in existence, not a new
object. The assertion was from the uncreated new object (no HWNDs).
Glad it's working!
Mark
|
|
|
|
|
By the way, if you want to give the user choices before closing then give the user the choices
BEFORE calling CFrameWnd::OnClose(). Only call the base class if the user chooses to exit the
app. If the user cancels or chooses to continue, just return from your OnClose() method.
Mark
|
|
|
|
|
OK.
Thank you.
Fortitudine Vincimus!
|
|
|
|
|
Tara14 wrote: I have created a SDI with CFormView as the view (VC++6). I would like to add some code to do something when the 'X' button of the document is pressed.
What's wrong with the app's ExitInstance() method?
You could also handle it in the frame's DestroyWindow() method.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: What's wrong with the app's ExitInstance() method?
Dont know about that.
DavidCrow wrote: You could also handle it in the frame's DestroyWindow() method.
The problem with DestroyWindow is that it closes off the application. I put a MessageBox there and checked how it worked. The application closes and then the MessageBox is displayed. Whereas I need to give the user some choises before the application closes.
Fortitudine Vincimus!
|
|
|
|
|
Normaly,the selected item and the unselected items have different item height.
Is there any way to change the height?
I want a tabctrl that the selected and the unselected items have the same height without owner draw.
Because,xp theme would not take effect on a owner draw control.If I try to enbale xp theme on a owner draw button,it seems easy.but for a tabctrl,I got a lot problems.
thank you for your attention.
3.141592653.... Never Stop!
|
|
|
|
|
How to find the DNS that is configured using C++?
|
|
|
|
|
Just how is it that you know the DNS server was configured using C++?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Does GetAddressByName() with NS_DNS namespace give you the addresses you're looking for?
Mark
|
|
|
|
|
hi
CDib is a class which will be used in iamge processing.i read otherwise project, it uses CDib class name, but its corresponging source and head file names are dib.cpp and .h. I would like to know how to realize this. thank you.
whitesky
Li Zhiyuan
22/10/2006
|
|
|
|
|
li zhiyuan wrote: I would like to know how to realize this. thank you
Three posts about the same topic? Why not reply back to one of the people that have tried to help you already?
Your posts are very confusing, what do you want to do with the aforementioned files?
I take it you have two files you would like to rename?
dib.cpp & .h (which isn’t a valid file name)
Going out on a limb it almost sounds like you wan to rename those files to cdib.cpp & cdib.h? Why would you want to do that? Most Coding conventions separate Class name from the file name (mostly to easily distinguish the two).
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Same question.You aksed yesterday
|
|
|
|
|
hi!
Could you please recommend some c++ library for networking tasks? I tried BOOST.ASIO, but it is only at the development stage, and IMO there are many bugs there.
thanks!
|
|
|
|