Re: Batch file and MFC (Properly Terminating Application)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.

.



Relevant Pages

  • Re: how do people feel about exit function from loop
    ... How do people feel about using exit function from inside of a loop? ... I'd say no, it is not bad practice, just more restricting (as in forcing your results, ... If ConditionalFormatting_FindFormatData.Format = strFormat Then Exit For ...
    (microsoft.public.vb.general.discussion)
  • Re: The rap against "while True:" loops
    ... E. W. Dijkstra used to advocate that every loop have exactly one entry ... point and exactly one exit point, i.e. no multiple break statements. ...
    (comp.lang.python)
  • Re: Infinite Loops and Explicit Exits
    ... > CS> One of these proposals relaxes the current restriction that an EXIT ... > termination of the loop is not visible at that point. ... > terminating condition is visible in that context. ... > You now want to allow this remote procedure, ...
    (comp.lang.cobol)
  • Re: Houston-related rants was Re: forced merges/inside lane merges/AASHTO "tapered merges"
    ... >> Are you sure about the North Loop and I-45? ... >> in particular the westbound exit for Fondren/Gessner. ... How could HCTRA put an exit ramp for eastbound ... and the West Houston Center Blvd exit still shows Old Westheimer ...
    (misc.transport.road)
  • Re: Strategies with SPARK which does not support exceptions
    ... The only way of interrupting a code sequence in SPARK is the exit ... pass' loop with an unconditional exit at the end. ...    Some complicated code that might set OK; ...
    (comp.lang.ada)