Click here to Skip to main content
15,920,836 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSpecific device context ? Pin
Andrew Hoole4-Mar-02 0:27
Andrew Hoole4-Mar-02 0:27 
AnswerRe: Specific device context ? Pin
Tomasz Sowinski4-Mar-02 0:30
Tomasz Sowinski4-Mar-02 0:30 
GeneralRe: Specific device context ? Pin
Andrew Hoole4-Mar-02 2:12
Andrew Hoole4-Mar-02 2:12 
GeneralRe: Specific device context ? Pin
Tomasz Sowinski4-Mar-02 2:17
Tomasz Sowinski4-Mar-02 2:17 
QuestionThrowing exception on thread end ? Pin
Alwin753-Mar-02 23:49
Alwin753-Mar-02 23:49 
AnswerRe: Throwing exception on thread end ? Pin
Tomasz Sowinski3-Mar-02 23:57
Tomasz Sowinski3-Mar-02 23:57 
AnswerRe: Throwing exception on thread end ? Pin
Prem Kumar3-Mar-02 23:57
Prem Kumar3-Mar-02 23:57 
AnswerRe: Throwing exception on thread end ? Pin
Joaquín M López Muñoz4-Mar-02 0:26
Joaquín M López Muñoz4-Mar-02 0:26 
There's a number of reasons why this cannot be achieved in general, the most important one being that the compiler often assumes portions of code throw no expceptions and takes advantage of this for optimization. Also, if there's floating point arithmetic involved the issue becomes even more tricky, as these operations are usually performed by a separate coprocessor (you can think of them as performed by a microthread), which yields the approach of "everything can throw an exception" a hard one to handle. Other, less important difficulties are those posed by the hard time programmers will have if they must assume everything can throw --think of how you'd prevent memory leaks in such situations.
First releases of Java included this termination-by-exception approach, but later on they deprecated it for the reasons mentioned.
Of course, these problems can be tackled in C# as this language runs in a strongly managed environment. The downside is resulting poor performance.
That said, you can have a thread inspect for termination conditions and throw accordingly upon calling a selected set of DLL functions (even system functions from KERNEL32, USER32, etc.) Check PJ Naugter's HookImportFunctionByName v1.0 for details.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Generalcall by reference using pointers Pin
John Cruz3-Mar-02 22:54
John Cruz3-Mar-02 22:54 
GeneralRe: call by reference using pointers Pin
Prem Kumar3-Mar-02 23:32
Prem Kumar3-Mar-02 23:32 
GeneralRe: call by reference using pointers Pin
Rickard Andersson203-Mar-02 23:38
Rickard Andersson203-Mar-02 23:38 
GeneralRe: call by reference using pointers Pin
Rickard Andersson203-Mar-02 23:37
Rickard Andersson203-Mar-02 23:37 
GeneralRe: call by reference using pointers Pin
Michael Dunn3-Mar-02 23:39
sitebuilderMichael Dunn3-Mar-02 23:39 
GeneralRe: call by reference using pointers Pin
John Cruz3-Mar-02 23:41
John Cruz3-Mar-02 23:41 
GeneralRe: call by reference using pointers Pin
Joaquín M López Muñoz3-Mar-02 23:41
Joaquín M López Muñoz3-Mar-02 23:41 
GeneralRe: call by reference using pointers Pin
John Cruz3-Mar-02 23:49
John Cruz3-Mar-02 23:49 
QuestionWhat is a development plan? Pin
davilism3-Mar-02 22:43
davilism3-Mar-02 22:43 
QuestionExplorer like interface style ?? Pin
Walkerboh3-Mar-02 22:24
Walkerboh3-Mar-02 22:24 
AnswerRe: Explorer like interface style ?? Pin
Mazdak3-Mar-02 22:42
Mazdak3-Mar-02 22:42 
GeneralAnimateWindow => Pin
3-Mar-02 19:00
suss3-Mar-02 19:00 
GeneralRe: AnimateWindow => Pin
Mazdak3-Mar-02 19:39
Mazdak3-Mar-02 19:39 
GeneralRe: AnimateWindow => Pin
3-Mar-02 20:05
suss3-Mar-02 20:05 
GeneralAn annoyance Pin
Nish Nishant3-Mar-02 18:06
sitebuilderNish Nishant3-Mar-02 18:06 
GeneralRe: An annoyance Pin
Nish Nishant3-Mar-02 18:09
sitebuilderNish Nishant3-Mar-02 18:09 
GeneralRe: An annoyance Pin
Nish Nishant3-Mar-02 18:12
sitebuilderNish Nishant3-Mar-02 18:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.