I thought this might be somehow useful to the discussion: "Potential Errors Passing CRT Objects Across DLL Boundaries" http://msdn.microsoft.com/en-us/library/ms235460(v=VS.100).aspx And libzmq simply shines in this respect. Small simple "C" interface, and no reliance on managing resources other than it's own functions.