Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / June 2004

Tip: Looking for answers? Try searching our database.

Consuming .NET components from VC++ 6.0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lee Gillie - 10 Jun 2004 16:37 GMT
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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.