April
3rd,
2002
John Lam recently commented that the managed debugger on VC++.NET cannot evaluate pointers on managed code. He's right on the money, of course, and I just ran into this limitation a couple of days ago.
His idea of using #pragma unmananged
directives to ensure the relevant code is compiled as native, thus allowing the native debugger to take over, is a good one.
However, my personal preference right now for dealing with this situation is splitting my code in two: One unmananged static library (.LIB) project containing all native code, and a second managed library (.DLL/.EXE) that links against the unmanaged .LIB. I've found this works very nicely (and works with the debugger, too), and keeps the code cleaner.