I've been banging on this for hours, and beginning to think there may
be problems in the approach.
A class was implemented in VB.NET which performs encryption. It has
been tried in both a test harness, and at least one .NET application,
and seems solid. I've been told to use this functionality in an NT
Service written in Visual Studio 6 C++ with MFC support.
My approach was to wrap the .NET class in a .NET COM library. I did
not use inheritence. But rather, I instanced the useful class, and
provided just a few function calls and properties to get to the import
functionality.
In the C++ 6.0 Service I "import"ed the TLB, and am utilizing the
compiler features for COM.
The decryption call appears to work to a point. The output file is
produced. But the information produced in the wrapped instance,
exposed as properties which can be read after the operation are very
bogus. Soon after the service now goes into some kind of infinite
loop, and exhausts virtual memory.
My suspicion is that the threading used by the wrapped .NET component
may not be compatible with auto-magic COM support provided by the
VSC++ 6.0 compiler.
Are these known to be compatible without doing anything special?
- Lee
Brian Muth - 10 Jun 2004 17:14 GMT
This should work just fine. Mind you, I wouldn't use MFC for this. Why not
just call the interface methods directly?
Did you remember to call Marshal.ReleaseComObject? This will help prevent
memory leaks.
Brian
> I've been banging on this for hours, and beginning to think there may
> be problems in the approach.
[quoted text clipped - 25 lines]
>
> - Lee
Brian Muth - 10 Jun 2004 17:24 GMT
Oops, hit the send button too soon. Disregard the remark about
ReleaseComObject....
Brian