Welcome to MSDN Blogs Sign in | Join | Help

February 2007 - Posts

Some tips for P/invoke

Here are some tips I've learned the hard way after wrapping some nasty things into managed code (including wrappers for the native debugging API and reading minidumps): Use resources like Pinvoke.net and Fxcop (which may have some useful marshalling checking
Posted by jmstall | 2 Comments
Filed under:

Ratio between Managed and Native Modules

There is not always a 1:1 correlation between Managed modules and native modules. For example, Sometimes it's (managed:unmanaged) 1:1. (Normal file-based modules) This is the common case, so people tend to assume it's always true. Regular file-based managed
Posted by jmstall | 2 Comments

'throw e;' vs. 'throw;'

Someone asked what the practical differences are between 'throw;' (no arguments) and 'throw object;' (in C# syntax). Specifically, what's the difference between: catch ( Exception e) { throw ; } and catch ( Exception e) { throw e; } This is mildly related
Posted by jmstall | 10 Comments

Making Catch, Rethrow more debuggable.

I previously mentioned that catch / rethrow an exception impedes debuggability because the callstack is unwound at the catch block, and thus you lose the callstack in the debugger. On technique to fix this is to take advantage of Just-My-Code ,which was
Posted by jmstall | 3 Comments
Filed under:

Catch, Rethrow, and Debuggability

When you catch and re throw an exception, the stack is unwound by the time the catch clause is executed, and thus you may lose valuable information in the debugger. Consider the following code snippet: static void Main( string [] args) { Func1a(); } static
Posted by jmstall | 18 Comments
 
Page view tracker