Miscellaneous Debris

Avner Kashtan's Frustrations and Exultations

Browse by Tags

All Tags » C++/CLI (RSS)
Tales from the Unmanaged Side – System.String –> char* (pt. 2)
A while ago, I posted an entry about marshalling a managed System.String into an unmanaged C string, specifically a plain char*. The solution I suggested, back in 2007, involved calling Marshal::StringToHGlobalAuto method to allocate memory and copy the...
Upgrading all projects to .NET 3.5
A simple macro to change the Target Framework for a project from .NET 2.0 to .NET 3.5, hacked together in a few minutes. This will fail for C++/CLI projects, and possibly VB.NET projects (haven't checked). Works fine for regular C# projects, as well as...
Another minor C#/C++ difference - adding existing files
Another minor detail that bit me for a few minutes today. I'm posting this so I'll see it and remember, and possibly lodge it in other people's consciousness. Using Visual Studio 2005, adding an existing .cs file to a C# project will cause a copy of that...
Unmanaged deployment is a true DLL Hell
By a staggering margin, most of my problems integrating C++/CLI code into my C#-based project has been deployment problems. Without fail, every integration or test deployment will be plagued with inexplicable problems. I'll try to list a few, with their...
Posted: Aug 30 2007, 02:16 AM by Avner Kashtan | with 1 comment(s)
Filed under: ,
More Tales from the Unmanaged Side - System.String -> char*
Today, I had a very tight deadline to achieve a very simple task: pass a managed .NET string to an API function that expects a null-terminated char*. Trivial, you would expect? Unfortunately it wasn't. My first though was to do the pinning trick that...
A C# coder in a C++/CLI world, part 1
Recently I've found myself stumbling around some C++/CLI code. C++ is a language which I learned years ago and never really worked with seriously, so I've been cursing and moaning as I worked. Strange for me to go back to a (partially) unmanaged environment...
Posted: Aug 28 2007, 04:48 PM by Avner Kashtan | with 5 comment(s)
Filed under: , ,
More Posts