Re: Batch file and MFC (Properly Terminating Application)
- From: "one-trick-pony" <worldofpain.aamir@xxxxxxxxx>
- Date: 2 Feb 2007 11:22:28 -0800
Thanks Joseph. I really liked your line by line breakdown of dummy
code. Fact is, I never worked with MFC before and I wanted a response
like that to tell me what I am doing wrong. I was expecting some
professional to come along and declare my code nightmare. I already
have your website marked as favorites in my internet explorer. I went
there today to read up on CString. There is TONS AND TONS AND TONS of
information on MFC. I can read but I can't remember everything. Best
solution is to actually write nightmarish code and have someone look
at it and then make corrections-that is, practice, practice and
practice.
In my code, I allow user to be able to exit code at two different
times(inside AutoRun function). I have a function called DoEvents
that processes user input(messages) such as clicking of Exit Button.
I give user a few seconds for each input via a while loop where I call
Sleep function with 100msec each time through loop and loop runs for
about 1000 times which is roughly 10 seconds window for user to click
on exit. Sleep fucntion is within that loop as well as DoEvents
function. I feel like there is LOTS of room for improvment. I have
barely begun to scratch the surface. This approach works but do I
think it is professional engineering? Probably not. Thats why I am
here-to understand and learn professional software engineering.
One of the main challenge is amount of information I have to
understand to become good programmer. Please, often visit this post
because, I will be asking more questions. Now I am off to your
website reading up on world of threads! I thank you for your effort
of breaking down my code line by line-a true teacher! :p Currently, I
do utilize functions inside AutoRun that branch off other processes
via CreateProcess. I also used WaitForSingleObject function to keep
my program in syncrohnization. This is my first time using these
functions. I am still in learning process and working toward becoming
a better coder.
Thanks for help.
.
- Follow-Ups:
- Re: Batch file and MFC (Properly Terminating Application)
- From: Joseph M . Newcomer
- Re: Batch file and MFC (Properly Terminating Application)
- References:
- Batch file and MFC (Properly Terminating Application)
- From: one-trick-pony
- Re: Batch file and MFC (Properly Terminating Application)
- From: Joseph M . Newcomer
- Batch file and MFC (Properly Terminating Application)
- Prev by Date: Statically Linked App Crashes on ~WindowDC
- Next by Date: Re: MFC, Threads, PostMessage, and Reentrant WindowProc
- Previous by thread: Re: Batch file and MFC (Properly Terminating Application)
- Next by thread: Re: Batch file and MFC (Properly Terminating Application)
- Index(es):