Questions tagged [com]

Component Object Model (COM) is a component technology from Microsoft, featuring remoting, language independence and interface-based programming. For questions about the COM serial port, you should use the [serial-port] tag instead.

Component Object Model (COM) specifies an architecture, a binary standard, and a supporting infrastructure for building, using, and evolving component-based applications.

Some of the core features of COM are:

  • A remoting infrastructure
  • The use of interface-based programming
  • A threading model
  • The ability to write language independent components.

COM is the foundation of technologies such as OLE, ActiveX and COM+.

COM predates .NET and although .NET has replaced some of the features that developers use COM for it is still a crucial technology and the foundation of most inter application communication on Windows.

External links

12235 questions
4
votes
2 answers

Calling a function of a 32-bit DLL from a 64-bit Application

I have a 32bit dll (no source code) that I need to access from 64bit C# application. I've read this article and took a look into the corresponding code from here. I've also read this post. I'm not sure that I'm asking the right question, so please…
theateist
  • 13,879
  • 17
  • 69
  • 109
4
votes
2 answers

ErrorMessage in Excel

i got a urgent problem with the following error, while setting the DisplayAlerts-property of the Excel ApplicationClass to false. var excel = new Excel.Application(); excel.DisplayAlerts = false; I get the following error message in the…
MacX
  • 587
  • 5
  • 16
4
votes
1 answer

How to make COM object's method be run not in main thread

I have a windows service which implements a COM local server. When running as application the COM object methods are called in a separate (not in the main) thread which is just fine. Things change when running as service - then COM object methods…
Nedko
  • 567
  • 4
  • 12
4
votes
1 answer

Call .Net C# DLL method from Classic ASP

I'm working on a classic asp project that needs to send a string to a DLL who will serialize it and send to a Zebra Thermal Printer. I have already build my DLL and registered it using regasm followed by /codebase which make IIS recognizes…
4
votes
3 answers

On Windows7, regsvr32 doesn't write to HKCR\CLSID

I have created a new simple COM object in Visual Studio 2008 using the ATL-wizard. The object has a single class and simple methods. The ATL-wizard did generate .rgs-files for my class. When I run regsvr32 Simple.dll on my XP machine the class is…
leiflundgren
  • 2,876
  • 7
  • 35
  • 53
4
votes
1 answer

Creating a callable function in a VSTO office addin - COMAddIns.Object is always Nothing

I want to be able to call a function in a VSTO addin from an Excel VBA macro. To test the principle I have the following C# code. namespace ExcelAddIn1 { [ComVisible(true)] public interface IThisAddIn { String GetText(); } …
Steve Mc
  • 3,433
  • 26
  • 35
4
votes
2 answers

Understanding how to use COM in Python

I'm attempting to implement the equivalent of a VB program in python using COM. Here are the relevant lines from the VB program: eConCall = New Microsoft.Dynamics.GP.eConnect.eConnectMethods eConCall.eConnect_EntryPoint(sConnectionString,…
Parand
  • 102,950
  • 48
  • 151
  • 186
4
votes
2 answers

Wrong exception after calling .net4.0 com server from delphi application

We are migrating our codebase from BDS2006 to Rad Studio XE, and we found some very strange behavior: if we make invalid floating point operation (ie. division by zero) after creating some object from COM server implemented in .Net4.0, we don't get…
MarekBaron
  • 537
  • 3
  • 18
4
votes
0 answers

How to call Windows COM object like Excel.Application from node.js with electron?

How to call Windows COM object like Excel.Application and Outlook from node.js with electron? I find the win32ole but it is 5 years old. I am using Office 2016. It seems like the electron-edge or edge can do the job but do you have any example?
palazzo train
  • 3,229
  • 1
  • 19
  • 40
4
votes
1 answer

API from C++ application with best performance

When calling C++ functions from C# code, which way gives the best performance? COM interop C++-CLI (is that future proof?) HTTP REST API Something else? I imagine that COM interop gives best performance, and that the performance falls quickly when…
magol
  • 6,135
  • 17
  • 65
  • 120
4
votes
2 answers

Accessing a remote COM object via C#

I have an exe file written using unmanaged C++ which contains a COM object. In order to access it from a managed C# application, I generated an interop assembly. I was able to use this with great success when both apps were running on the same…
AntonyW
  • 2,284
  • 16
  • 21
4
votes
1 answer

Is there a way to automate BLF to CSV conversion in Vector CANoe?

My first approach was using python-can (as it added support for parsing BLF files with 2.0.0 release) like this: import can filename = "logfile.blf" logging = can.BLFReader(filename) for msg in logging: print(msg) but that resulted in an error…
z33k
  • 3,280
  • 6
  • 24
  • 38
4
votes
2 answers

Dynamically load and use COM object in C#

I have a C# project, where I would like to access MS outlook, if it is installed on a client´s machine. The "access outlook" part has been done by referencing the outlook COM object, and going from there. My problem is now the "if it is installed"…
Boris
  • 5,094
  • 4
  • 45
  • 71
4
votes
4 answers

Which HRESULT to return when a buffer provided is too small?

I have a function in an IUnknown-derived COM interface: HRESULT GetPassword( [in] long bufferLength, [out] WCHAR* buffer ); and the contract is that the implementation should check whether the buffer is large enough to store the string being…
sharptooth
  • 167,383
  • 100
  • 513
  • 979
4
votes
1 answer

Passing objects from C# to VBA using COM Interop

Is it possible to pass a custom object (like MyClass[]) from C# to VBA using COM? If not, which is the best solution to get this working?
Marcus
  • 113
  • 1
  • 7