I have recently written a .NET wrapper for a C++ DLL file and it seems to be
working well, but I do have some concerns about memory. From my limited C
programming experience (college 15+ years ago), I seem to remember that when
using structures etc in C, you had to allocate memory to them then
deallocate them when you had finished using them. My C# code creates a
variable of type structure, passes it to the C++ DLL and then returns
whatever data is necessary, without deallocating the structure reference. I
tried setting it to null, but the compiler wouldn't accept that as it said
it was a value type. Do I actually need to do anything or does the automatic
garbage collection take care of it for me? One thing I have to avoid is a
memory leak every time I make a call to the DLL. I am using VS 2005 and the
compact framework (2.0). Thanks in advance.
Andy Baker