Questions tagged [com-interop]

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.

Resources:

1845 questions
0
votes
2 answers

How can I fix "Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' / The RPC server is unavailable"?

I get the above error, which suspends activity in my app, when run on a particular machine. When I run it on my own machine, no such error occurs. Perhaps "The RPC server is unavailable" is the crux of the problem, but what would cause that to pop…
0
votes
1 answer

Unable to set SlideSize property while using powerpoint interop

We are trying to convert PPT file to PDF using Powerpoint Office Interop. We are using ExportAsFixedFormat() to do the conversion as shown in the below code snippet: public static void ConvertPowerPointToPdf(string inputFile) { …
Saket Kumar
  • 4,363
  • 4
  • 32
  • 55
0
votes
0 answers

From C#, not seeing exposed methods of COM objects

I have Visual Studio 2015. I created a Visual C++ ATL project. I named it WinHookLayer. Using Wizard I added a class and selected ATL COM+ 1.0 Component and created a class with short name HookWrapper and clicked Finish. From class view, I added a…
Avinash
  • 385
  • 3
  • 11
  • 26
0
votes
1 answer

How to map Excel cells to a VBA function returning table of data?

I have a dll exposed via COM to VBA macros in my Excel workbook. In the dll, the primary function takes as input a bunch of data from various cells in the worksheet, and produces a table of outputs to be displayed elsewhere on the same excel…
tbischel
  • 6,337
  • 11
  • 51
  • 73
0
votes
0 answers

How to enable tracing in a c# interop assembly

I would like to trace HTTP communication in my c# assembly (.Net 4.5). As the .Net code is wrapped with COM interop and finally used in COM container applications I have no app.config file of the main app to configure tracing the usual way. What I…
0
votes
2 answers

how to pass two columns values to plot line chart in C# interop

I am trying to plot line chart after generating excel file using Microsoft interop. Let my column A is Date, B is Rate and column C is volume and I want to print a chart between Volume and Date. I am using this code to plot line chart. var charts =…
Saurabh Agrawal
  • 7,581
  • 2
  • 27
  • 51
0
votes
1 answer

Marshalling ref IntPtr to BSTR * in C#

I am trying to call a function which allocates memory for the string and then does something with the string. Here is the basic example which illustrates the problem: C++: STDMETHODIMP CFunctionsCollection::Function2 ( BSTR leftString,…
Vladimir
  • 1
  • 1
  • 1
0
votes
1 answer

COM component when used in C# causes InvalidCastException

i have a COM component, we have created a interop dll using TLBIMP tool and when accesing the default interface, it sometimes fails with InvalidCastException (Unable to cast COM object of type System.__ComObject’ ) private void…
user2101801
  • 719
  • 2
  • 8
  • 20
0
votes
0 answers

Handling the final incoming COM events after calling UnregisterTypeForComClients()

(context: Windows 10 desktop, no UWP) For handling Windows Action Center notification activation events I use a LocalServer32 C# console application, STA and Thread.CurrentThread.Join() calls*. This works just fine. The executable is started and I…
Kay Zed
  • 1,304
  • 2
  • 21
  • 31
0
votes
1 answer

Add button in Internet Explorer from C# application and copy content

I want my C# application to open an Internet Explorer window. So far I have figured out how I'm doing: using SHDocVw Type oType = Type.GetTypeFromProgID("InternetExplorer.Application"); if (oType != null) return…
magol
  • 6,135
  • 17
  • 65
  • 120
0
votes
0 answers

Closing an Excel application without com references? Excel continues to run in the background

I've got this set of code, now, I know you have to dispose com references and run the garbage collector after accessing excel, but my particular code doesn't write excel references to variables... how do I dispose the excel app properly in this…
Avan
  • 223
  • 3
  • 13
0
votes
1 answer

Instantiating COM class giving an error

I executed the following C# code to Test environment and PROD server: This code checks if it is able to instantiate COM classes on the servers: try { Type creatorType = Type.GetTypeFromProgID("A.B"); …
Jimmy
  • 2,106
  • 12
  • 39
  • 53
0
votes
1 answer

NOINTERFACE Exception instantiating a COM component from C#

I have an exe file “ClarityII.exe” supplied by the vendor of a weather monitoring product (Boltwood Cloud Sensor II). The app provides a GUI for displaying and controlling the sensor state, and provides a COM interface to integrate with other…
Darren M
  • 3
  • 3
0
votes
1 answer

Correct way to get an interface / object from an interface pointer?

Having known nothing about interfaces until now, I am having a remarkably hard time trying to actually implement the solution given to this question. I think I am correctly getting the pointer to the IShellFolder interface, but I don't seem to be…
Binarus
  • 4,005
  • 3
  • 25
  • 41
0
votes
1 answer

How to dispose of Excel.Application class correctly

I have a real pain of an issue whereas the Excel.Application() does not want to get released, no matter what. Even after a new class is instantiated and disposed immediately afterwards, it still appears in the process list. if (_ExcelApp == null) …
Rudolf Lamprecht
  • 1,050
  • 1
  • 14
  • 37
1 2 3
99
100