views:

551

answers:

3

I have recently had an issue accessing MAPI through the dot net framework (explained in this artical) that in turn has generated memory access violation errors.

To get around this I opted to use a third party component from code project with a visual C++ core however we still have the problems.

I have never used visual C++ myself however one thought is that if the C++ core (compiled in visual studio 2005 using visual C++) has the memory managed by the framework it too may suffer the same issues.

Does anyone know if the memory of a visual c++ application is managed by thew framework?

A: 

Unless you are using Managed C++ (which it doesn't sound like you are) then no, the memory is not managed by the CLR.

The recommended method of talking to Exchange in .Net is via WebDAV.

samjudson
A: 

I'm not entirely sure what you're asking, but i'll give it a shot.

Visual C++ is a pure C/C++ compiler so has none of .NET's memory management, nor any of its runtime -- You have to manually call new and delete.

.NET also provides Managed C++, which is a slightly modified version of C++ that targets the .NET runtime, and is GC aware -- eg. its memory is managed by the .NET runtime.

Without more details about your bug I can't really make any suggestions, beyond suggesting that you make sure you use the appropriate GC guards, and the provide finalisers in any place they are needed.

olliej
+1  A: 

The two previous answers have mentioned "Managed C++", this is an old bolt-on that they did to allow you to use managed C++ in a .NET environment. It wasn't a first class citizen - unlike C++/CLI (link text. But to answer your original question, no, Visual C++ is not managed by the .NET runtime. Managed C++ & C++/CLI are.

Mark Ingram