.NET outside COM objects that share static instances in API calls

It is hard to explain our situation.

We have a three-tier application. This engine is a C ++ encoded DLL, then we have a VB6 ActiveX EXE that has access to the engine through API calls, and at the top level we have an Excel Addin (in C # using the VSTO infrastructure), which calls the middle level using the on-board DLL. At this time, every “connection” from Addin to the engine creates a new EXE (VB6 uses API calls to access the engine), and everything works fine. Now we move the middle layer to .NET, it works “presumably” perfectly (it passes all our Unit tests), but we found an error when we open 2 “connections” at the same time (ups, no unit test check this situation, because it's new occasion). A DLL has static objects that it shares across all instances in one process,and we have interactions between “connections”. In our old version, each “connection” creates a new EXE without exchanging memory between processes, now it is the same process, and they exchange memory and static objects.

Following the advice of this question . We tried to create a COM EXE in C # to make objects outside the process in the middle layer, but we have the same result. They share static objects; in the end, each connection does not create an independent process.

It is clear, but not available at this time, moving API calls to ATL or changing static objects to uncontrolled links using a handle and changing all API calls to get / set these handlers. I looked through all the examples in MS All-in-one , but I did not find any solution. It is impossible to support only one connection at a time, each book can have one connection, and in the future we want to learn a web application with several connections at the same time.

Any suggestion?

Thanks in advance,

+3
3

COM EXE COM- EXE , , CoRegisterClassObject.

http://msdn.microsoft.com/en-us/library/ms693407(v=vs.85).aspx

http://msdn.microsoft.com/en-us/library/ms679697(v=vs.85).aspx

REGCLS_SINGLEUSE REGCLS_MULTI_SEPARATE.

, , - , COM EXE.

+3

, , " ", , VB6 EXE, DLL.net. , , .

VB6 EXE com . dll dll ( dll Vb6 ) + + .

.NET-EXE, COM, exe VB6, (, ) EXE-, .

, , , , . , VB6 exe .net. dll.

+2

.Net? , , COM- .net- COM-. Primary Interop Assemblies. SO, , .

+1

All Articles