0

Is it OK/possible to have a shared memory in a COM object which will be consumed by applications built using C# and/or C++?
Can C# access shared memory in COM object without crash?

Thanks,
Adi Barda

2 Answers 2

1

Yes it is you need -- all you need to do is create a memory mapped file. If you can't do this in .NET directly, you need to do it in C/C++ code which you embed and call from your .NET application.

Making it crash proof requires understanding the underlying subtleties properly, for that boost::interprocess might help as it abstracts these quite well.

Sign up to request clarification or add additional context in comments.

Comments

0

I don't really see what role the COM object plays in this. But, no, there isn't anything that makes MMFs fundamentally incompatible with managed code. They are merely very awkward to use since you need pointers to access them.

Support for MMFs is coming in .NET 4.0. It is probably too soon to use that in production code. But do make sure to take a look at the API so that what you do now is going to fit the API well when you switch.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.