George
Tue Jun 05 13:12:57 CDT 2007
Charles, et al,
To return to my original question, I surmise that there is no way for a code
fragment to discover whether or not it is in a critical section, even if it
knows the possibilities.
Regarding error handling, I thought I was following the guidelines of
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VSADD.v10.en/dndeepc/html/deep061799.htm.
Apparently not. For what it is worth, the code does run with different
errors added to test the things I can (no such file, run out of memory,
illegal mem ref). I would appreciate a simple example code fragment that
will break my error handling. I seem to learn best this way.
I am not using MFC (did I say this was legacy code?), and I am using the
/EHa compiler switch and #include exceptions.h.
It will take me awhile to sort through all the comments and suggestions
because, while I accept the suggestion to keep independent track of the
critical section usage, I really would like to understand the innards of the
SE and EH. It seems to offer a way to organize all or most of the error
handling in an application, even in code bequeathed from times of yore. This
would be a big win and I think justifies a bit of persistence.
Thanks guys,
George
"Charles Wang[MSFT]" <changliw@online.microsoft.com> wrote in message
news:S7TQQP1pHHA.2368@TK2MSFTNGHUB02.phx.gbl...
> Hi George,
> I think that you may consider to redesign your function WorkerBee().
> Ensure
> that it will not throw any error and instead use return values to
> represent
> error codes. In this case, your critical section can also be safely
> executed.
>
> Please feel free to let us know if you have any other questions or
> concerns.
> Have a good day!
>
> Best regards,
> Charles Wang
> Microsoft Online Community Support
> =====================================================
> Get notification to my posts through email? Please refer to:
>
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications
>
> If you are using Outlook Express, please make sure you clear the check box
> "Tools/Options/Read: Get 300 headers at a time" to see your reply
> promptly.
>
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
>
http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ======================================================
> When responding to posts, please "Reply to Group" via
> your newsreader so that others may learn and benefit
> from this issue.
> ======================================================
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> ======================================================
>
>
>