Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dispose VFP component
Message
General information
Forum:
ASP.NET
Category:
Web Services
Miscellaneous
Thread ID:
00902836
Message ID:
00902953
Views:
21
>Should my C# application specifically release the VFP COM component? If yes, how?
>
>Thanks

Hi Mark,

From what I know you should not.

Runtime Callable Wrapper (RCW) manages COM creation. So, COM lifetime is controlled by Common Language Runtime. The COM component is freed from memory when .Net garbage collector calls the Finalize() method in Runtime Callable Wrapper. Internally it calls Release() of IUknown interface of the actual COM object.

To explicitly remove COM object from memory you can invoke the static method on Marshal class in System.Runtime.InteropServices namespace:
using System.Runtime.InteropServices;     
Marshal.ReleaseComObject(myComObjectRCW);
See also:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcoricominteroptutorial.asp
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform