C# using ActiveX control.

T

TList

Hi there,

Quick question to all of you proffs out there :)

I have a native COM component that does it's own memory management. It works
well in unmanaged code, however as soon as I use it in a managed application
it behaves funny, specially when it's heavily used and the GC collects
frequently.

I've read in various post that wrapping the component in an ActiveX EXE
control will host the component in a seperate process and thereby the GC will
not affect the component.

Is this correct?

Is it enough just to wrap this component's classes individually with the
same names and properties, just redirecting the calls to the internal
memeber, and use this ActiveX EXE from my managed code?

Thanks
 
T

TList

Hi Pete,

Thanks for your reply.

We proberbly all know the issues with CDO and managed code.
Because the code I'm refering to is a part of a legacy implementation I'm
not allowed to discuss it further, but it resembles a lot the CDO issues.

A simple case of enumerating folders and messages within can cause issues in
managed environments.

As I understand it an ActiveX exe would run in a seperate process when used
from managed code. Imagine wrapping the MAPI.Message, MAPI.Folder and
MAPI.Folders in an Active X exe.

Would I be able to reference my custom objects in an ActiveX in the managed
code thereby using the same methods for enumerating the object.

Pseudo sample:

Before:
MAPIFolder = MAPISession.GetFolder(KEY);
MAPIMessages = MAPIFolder.Messages;
for(int i = 1; i <= MAPIMessages.Count; i++)
MAPIMessage = MAPIMessages.Item(i);

After
MYFolder = MYSession.GetFolder(KEY);
MYMessages = MYFolder.Messages;
for(int i = 1; i <= MYMessages.Count; i++)
MYMessage = MYMessages.Item(i);

Where ei.
MYFolder.Messages == return new MYMessages(private_MAPIFolder.Messages);
MYMessages.Item(i) == return new MYMessage(private_MAPIMessages.Item(i));

And so on.

Hope you see the point, generally it's a question of it its enough to just
wrap the objects or I have to contain the processes also so only simple types
are exchanged.

Thanks,
TList
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top