It depends somewhat if you are using MFC or not.
I think you could make it an OCX.
Start with an ATL/Com project (if you need MFC, then check its checkbox), then insert a Full control into the project. It will give you a OnDraw() etc function in which you can draw the waveforms.
However this may not be the only way or the easiest.
If you can catch the exception using a catch all (catch(...)), then you are likely not catching the MFC exception correctly.
Remember that MFC exceptions are caught by pointer, not by reference or value. And you must call Delete() off of the caught exception pointer if you do not re-throw it.
-=- JamesIf you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
In addition to the above responses, you could also try: (I know WinExec is old but since it works still) WinExec("cmd /c ren c:\\a.txt b.txt", SW_HIDE);
It is the /C switch which causes cmd.exe to terminate after executing the command. And the second parameter to WinExec: SW_HIDE causes the window not to be shown.
If the program should run on Win9X also, then make it command.com instead of cmd.exe.
There was a problem with my program that it always return file pointer = NULL on the second (and further) attemps of openning file. So I tried to print out what error occured by using this command:
String error = strerror(errno) ;
The 'bad file number' was the message that I got in the string error.