COM interop is the layer that allows .NET assemblies to communicate with standard COM objects and libraries.
COM interop is the layer that allows .NET assemblies to communicate with standard COM objects and libraries by exposing it's own objects or wrapping external COM objects.
I'm using the Excel interop in C# (ApplicationClass) and have placed the following code in my finally clause:
while (System.Runtime.InteropServices.Marshal.ReleaseComObject(excelSheet) != 0) { }
excelSheet =…
I developed a Windows service using C#.NET to generate PDF report. To generate PDF file I am using a third party dll. The application is running in my Windows XP platform. When I deployed the service in Windows Server 2008 64 bit version, I got this…
In .NET perspective:
What is a memory leak?
How can you determine whether your application leaks? What are the effects?
How can you prevent a memory leak?
If your application has memory leak, does it go away when the process exits or is killed? Or…
I have created two .NET Interop assemblies from two different third-party COM DLLs. Both of the COM DLLs contained a type named COMMONTYPE. Therefore, COMMONTYPE is now exposed through the two Interop assemblies as well.
I have a third project that…
What is the real difference between these two options? What I know is:
Register for COM Interop
This options executes regasm on the assembly and registers the assembly as an COM component(or maybe not) in the registry with all COM like registry…
What exactly does the VS project option "Register for COM interop" actually do? Because when I build my library with this option enabled I can call CreateObject on my library from VBScript. But if I build without this and then run regasm manually…
I am trying to build a small application in C# which should start/stop an IIS Express worker process. For this purpose I want to use the official "IIS Express API" which is documented on MSDN: http://msdn.microsoft.com/en-us/library/gg418415.aspx
As…
In my company the common way to release Excel Interop Objects is to use IDisposable the following way:
Public Sub Dispose() Implements IDisposable.Dispose
If Not bolDisposed Then
Finalize()
System.GC.SuppressFinalize(Me)
End…
I am attempting to capture some data from Excel from within a C# console application.
I get the error
Unable to cast COM object of type 'microsoft.Office.Interop.Excel.ApplicationClass' to 'microsoft.Office.Interop.Excel.Application'"
This code…
I am referencing a COM library in Visual Studio, so it has automatically created the corresponding Interop assembly for me. I would like to do a GetType() on these com objects, but they always return System.__ComObject. Querying them for an…
I want to know what the fastest way is of reading and writing data to and from an open Excel workbook to c# objects. The background is that I want to develop a c# application that is used from Excel and uses data held in excel.
The business…
I have rephrased this question.
When .net objects are exposed to COM Clients through COM iterop, a CCW (COM Callable Wrapper) is created, this sits between the COM Client and the Managed .net object.
In the COM world, objects keep a count of the…
I'm a limited user, and I need to write an Outlook macro that exposes a C# library in Outlook 2003 and 2007.
I do not have any admin privilges at all, not even at install time, so I can't run RegAsm and I can't (I assume) write a managed…
How can I return an array of objects (implementing a COM interface) from a C# method to a Java method via COM4J?
Example C# class that generates an array:
using System;
using System.Runtime.InteropServices;
namespace Example
{
…