May 2003 - Posts

TechEd Bloggers
Tomorrow morning I'm headed for Dallas, Texas to speak at TechEd 2003. Sonja Keserovic and I are giving the following talk: Interoperating with Unmanaged Code (DEV341) Room: D166 Time Slot: Wed, June 4 10:15 AM-11:30 AM Moving to the .NET Framework does Read More...
Posted 30 May 03 07:30 by Adam Nathan | 3 Comments   
Filed under
CLR SPY and Customer Debug Probes: The PInvoke Calling Convention Mismatch Probe
Defining a PInvoke signature and using DllImportAttribute correctly can be difficult to do, and you normally get little-to-no diagnostic information if you make a mistake. Some mistakes that can be made with PInvoke would be impossible for the CLR to Read More...
Posted 21 May 03 09:02 by Adam Nathan | 4 Comments   
Filed under
Blogging troubles resolved
I've fixed this posting, so read on! Read More...
Posted 15 May 03 06:24 by Adam Nathan | 2 Comments   
Filed under
CLR SPY and Customer Debug Probes: The Marshaling Probe
As promised, here's my first entry with more details about Customer Debug Probes and CLR SPY. The Marshaling probe is the easiest one to understand and great for experimentation since it's the only one that doesn't report on error/warning conditions. Read More...
Posted 15 May 03 06:18 by Adam Nathan | 1 Comments   
Filed under
Introducing Customer Debug Probes and CLR SPY
Version 1.1 of the .NET Framework introduces a handy feature called Customer Debug Probes (CDP). These probes enable you to find and diagnose difficult bugs lurking in managed code, even in a production environment. I'll share the details of each probe Read More...
Posted 13 May 03 01:24 by Adam Nathan | 16 Comments   
Filed under
Structures with embedded string fields
Tuesday's quiz used character arrays to represent string fields of the DEVMODE structure. Why not define them as strings, which would be more convenient to manipulate in managed code? If you define a structure field as a string, it is marshaled as a pointer Read More...
Posted 09 May 03 01:24 by Adam Nathan | 2 Comments   
Filed under
Quiz: What's wrong with the following code?
The following C# code has the goal of enabling managed code to call CreateDC , but it's incorrect. Calling all Interop aficionados... Can you see what's wrong? using System; using System.Runtime.InteropServices; internal class DeviceContext { [DllImport("gdi32.dll", Read More...
size_is in managed code?
IDL has a size_is attribute (as well as length_is, first_is, last_is, max_is, ...) that decorates a C-style array with enough information for it to be marshaled. Without such an attribute, the array would not be distinguishable from a pointer to a single Read More...
Posted 06 May 03 01:14 by Adam Nathan | 2 Comments   
Filed under
Page view tracker