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
40
votes
4 answers

Replicating Visual Studio COM registration with a WiX Installer

Once upon a time, a young, naive engineer thought it would be a good idea to separate out some of the functionality for his app into a COM component, written in C#. Visual studio had all the tools to do that, right? .NET was practically made for…
Robert P
  • 15,707
  • 10
  • 68
  • 112
40
votes
2 answers

Are *.tlb files ever used at runtime?

I'm working on a product that exposes some .NET API through COM interop. As a part of the build we generate *.tlb files for all such assemblies and deliver them as a part of a separate SDK package. Our customers can install the SDK on top of our…
Dennis
  • 2,615
  • 2
  • 19
  • 20
39
votes
2 answers

Best way to access COM objects from C#

I am planning to use various objects that are exposed as COM objects. To make them easier to use, I'd like to wrap them as C# objects. What is the best approach for this?
Tony the Pony
  • 40,327
  • 71
  • 187
  • 281
39
votes
2 answers

How to diagnose COM-callable wrapper object creation failure?

I am creating a COM object (from native code) using CoCreateInstance: const CLASS_GP2010: TGUID = "{DC55D96D-2D44-4697-9165-25D790DD8593}"; hr = CoCreateInstance(CLASS_GP2010, nil, CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER, IUnknown, out…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
39
votes
4 answers

What can you do with COM/ActiveX in Python?

I've read that it is possible to automate monthly reports in Crystal Reports with COM/ActiveX. I'm not that advanced to understand what this is or what you can even do with it. I also do a lot of work with Excel and it looks like you also use…
mandroid
  • 2,308
  • 5
  • 24
  • 37
38
votes
3 answers

How do you register a Win32 COM DLL file in WiX 3?

I found an example on registering DLLs, Registering an Assembly for COM Interop in a MSI file with the Windows Installer XML toolset., and WiX complains about the "AssemblyRegisterComInterop" attribute. I removed that and changed the "Assembly"…
Davy8
  • 30,868
  • 25
  • 115
  • 173
37
votes
11 answers

System.Runtime.InteropServices.COMException (0x800A03EC)

Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs() method is working fine on Windows server 2003 and also on XP but not on Windows server 2008. I copied it as it is gave all Dll's and permissions I have also tried all the solutions given on the…
Sameer S
  • 1,011
  • 1
  • 9
  • 9
37
votes
1 answer

Unload a COM control when working in VB6 IDE

Part of my everyday work is maintaining and extending legacy VB6 applications. A common engine is written in C/C++ and VB6 uses these functions in order to improve performance. When it comes to asynchronous programming, a C interface is not enough…
Vincent Robert
  • 35,564
  • 14
  • 82
  • 119
37
votes
2 answers

What's the deal with [ComVisible] default and public classes COM exposure?

MSDN has this article about [ComVisible] attribute. I don't quite get what happens when one sets [ComVisible(true)]. MSDN says The default is true, which indicates that the managed type is visible to COM. This attribute is not needed to make public…
user2166888
  • 579
  • 1
  • 5
  • 13
36
votes
4 answers

Does assigning null remove all event handlers from an object?

I have defined new member in my class protected COMObject.Call call_ = null; This class has the following event handler that I subscribed to call_.Destructed += new COMObject.DestructedEventHandler(CallDestructedEvent); Will setting my member to…
Dor Cohen
  • 16,769
  • 23
  • 93
  • 161
36
votes
1 answer

Why use FinalReleaseComObject instead of ReleaseComObject?

I know the basic difference as ReleaseComObject only decreases some counter by one and FinalReleaseComObject decreases it to zero. So what I usually hear is, call FinalReleaseComObject because then you are sure that the COM object is really…
Matthijs Wessels
  • 6,530
  • 8
  • 60
  • 103
35
votes
8 answers

The difference between traditional DLL and COM DLL

I am currently studying COM. I found that COM DLL is kind of built upon the traditional DLL infrastructure. When we build COM DLLs, we still rely on the traditional DLL export methods to lead us to the internal COM co-classes. If COM is for…
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
35
votes
9 answers

What does "Method '~' of object '~' failed" at runtime mean?

I'm trying to run a legacy VB6 application on my desktop (it doesn't have a user interface, being a command-line app), and when I do, I get a message box saying Run-time error '4099': Method '~' of object '~' failed This means nothing to me; does…
Cyberherbalist
  • 12,061
  • 17
  • 83
  • 121
34
votes
3 answers

Using Component Object Model (COM) on non-Microsoft platforms

I'm regularly running into similar situations : I have a bunch of COM .DLLs (no IDL files) which I need to use and invoke to be able to access some foreign (non-open, non-documented) data format. Microsoft's Visual Studio platform has very nice…
DrYak
  • 1,086
  • 1
  • 10
  • 15
34
votes
1 answer

Error 80040154 (Class not registered exception) when initializing VCProjectEngineObject (Microsoft.VisualStudio.VCProjectEngine.dll)

I'm trying to run this tool in order to convert a Visual C++ project to makefile. The project I'm trying to convert project is written in VS2008, so I'm using a reference to Microsoft.VisualStudio.VCProjectEngine.dll from version 9. It fails in this…
rkellerm
  • 5,362
  • 8
  • 58
  • 95