THanks for the reply. It's this function just checking whether the process is closed? How to close the process then?
oRion
Posts
-
Closing hh.exe when my programs exits. -
Closing hh.exe when my programs exits.Hi, I have launch the hh.exe ( help viewer) via CreateProcess(). I am trying to close this window when my main program exits. How do I do that? Here's a snip of my code... bSuccess = CreateProcess ("C:\\WINDOWS\\HH.EXE"," NATURAL.CHM", NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &ppi ); helphnd = ppi.hProcess; CloseHandle ( ppi.hThread ); CloseHandle ( ppi.hProcess ); The code is written as part of defining a 'Help' menuitem. Quite new to the idea of process, copy this idea from FAQ in this website. If CloseHandle is executed right after CreateProcess, that means the process should have finish and return to the executing program, therefore closehandle would do the cleaning up? Now, I am executing something in the ::OnCloseDocument(), how do I check whether the help program is still running,so that I wouldn't be trying to close the program? :~
-
Launching another dialog box in a dialog box classoRion wrote: How do I actually do that inside a dialog class calling another dialog class? Pavel wrote: There is nothing special with it - DialogBox API function or CDialog::DoModal(), if you are using MFC, executes a modal dialog. You need to set the modal dialog parent to the dialog you are executing it from. They return IDOK, if the modal dialog was closed with OK. Thanks for the reply. : ) I am not too sure where to set the modal dialog parent to the dialog? How to reference or get a handle in the parent dialog? :confused:
-
Launching another dialog box in a dialog box classhi, I have tried to implement a error prompt dialog box which pops up when I execute some calculations in a dialog box. I have tried to use modaless dialog but the program don't seems to stop for the corrected data from the Error Window to return before continuing the routine again. What should be a good way to have a dialog box to receive the data? By Modal dialog instead? How do I actually do that inside a dialog class calling another dialog class? :~
-
How to "SendMessage" to a listbox in a dialog class?Thanks for the information. I have tried to use GetSafeHwnd() instead, and pass it to the a global variable type of HWND. It works for now. :)
-
How to "SendMessage" to a listbox in a dialog class?Yup, that's right. But I am not sure how to get the handle for my dialog box. Do you have any suggestion? So right now I am sending to the main window. :wtf:
-
How to "SendMessage" to a listbox in a dialog class?I am currently writing a program which is ported from C++ for DOS. I have a routine which handles the output messages to the screen in DOS, but now I am trying to output it to a ListBox in a Dialog box. Here a fragment of the code i have written.. #include "stdafx.h" void utility::message() { SendMessage(0,WM_MYCALL,0,0); } WM_MYCALL is a handler I defined in a dialog class. Apparently, when I tried this command, nothing really happen. My program is a SDI program. Somehow, WM_MYCALL is not process at all by the dialog class? Why does this happen? Is there something I missed out?:confused:
-
Update Statusbar from a non-window class method.Thanks for your reply. I have tried to use that statement u mention. It can't work, apparently SetMessageText is not a member of AfxGetMainWnd(). :confused:
-
Update Statusbar from a non-window class method.Thanks for your reply, jhwurmbach! I think I have to repharase my question. I have written a class method which does all the screen output, but the output is onto the screen via "cout". Now, I am trying to rewrite this class such that I could output my message onto the statusbar in windows instead. I understand that "CView" is the one that handles the output in windows. I am trying to change my original DOS-output class to a windows-output class one. I hope u can understand what I am trying to say. U have any suggestion? :rolleyes:
-
Update Statusbar from a non-window class method.I have written a class in a seperate file which I want access to the statusbar. How do I change the message in the statusbar from this class? I have included the "stdafx.h" in the class I defined. :confused:
-
Moving class files from C++ to VC++All right thanks for info. :-O
-
Where to place handler? CView/CDoc/Mainfrm?Thanks for your replies guys! Just want to make sure we are talking the same thing here. Basically I am confused about where to place my menuitem handler, ie, OnMyMenuItem. They could exist in all the DOC/VIEW/MainFrm, and the functions are accessible in all of them also. Just don't know the different between them. I am working in with a SDI program. So probably, I will be working either with CView/CDoc or Mainfrm/CDoc , right? There isn't much different with CView and Mainfrm since they are the same? ;)
-
Moving class files from C++ to VC++I have built up some classes defining my program, they work perfectly in DOS. I am moving in Windows with VC++ 6.0, I am trying to output the messages of my program in a Edit box. The problem is the intergration part, I have port my program into VC++ environment. I just get mainfrm.cpp to inherit all my functions, and got the program running linking to a menu item. How do I actually output the messages into a Edit box? I know of using some MessageBox will be able to do that, but the messages are supposed to update the user on the progress of the program, so pressing the "OK" button for the user is quite tedious everytime there is a message! Any one who has some suggestions on integration into Windows? :eek:
-
Where to place handler? CView/CDoc/Mainfrm?It seems that I could create handlers in these files, that I could used. They are quite similiar in nature, seems to me most of functions are visible to all CView/CDoc/Mainfrm? Anyone care to share what's the different between these files?
-
Updating and changing Title Bar in ApplicationThanks for the information. I was trying a few ways to do it and it's working!! Just curious, is there anyway I could replace the whole line of the title bar. I mean I could replace the Untitled part, but not able to get rid of the program name at the end of the string. :-D
-
Updating and changing Title Bar in ApplicationI have been looking through the threads of in the board.Can't seems to be able to understand how to do it. I need to get rid of the ugly message in the Title bar with "Untitled - myprogram" and update it with my own message. Anyone that can help me on that? Please try to include some lines of codes. I am really very new in VC++ 6.0. :confused::confused: Thanks!:omg:
-
How to use Complex Template Class function?I have come across this function in the class template. template complex conjg(const complex& x); how do I access this function? :((
-
using complex template functionsThanks for the reply. I can't seems to get it compile under VC++ 6.0 Here's what I have attempted to do. #include #include using namespace std; void main() { complex abc; double myvar = abc.conjg(); cout << myvar; } When I tried complied it... the error is as follows.. error C2039: 'conjg' : is not a member of 'complex' What's wrong here? It's seems that conjg is not visible in the class? :confused::confused:
-
Controlling iostream display behaviour.Thanks for the reply. I can set it using setprecision() and setw(), but I can't change it's behaviour. I mean I like my scientific notation to have 2 digits before the decimal points not the default( ie. 1.23E+010) , I was hoping to get 12.34E+009 . Hope u can understand what I mean.I am converting a code from FORTRAN which allows this to happen. X|
-
using complex template functionsI have stumbled across this function "conjg" in the complex class template. But I don't seems to be able to access it. Any kind soul can tell me how to access this function? Thanks in advance! :confused: