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
5 answers

Has .NET made raw COM and DCOM programming redundant?

Has the introduction of the .net framework made raw programming in COM and DCOM redundant ? (Except for using some COM+ services, e.g. for transaction management through the System.EnterpriseServices namespace)
David
  • 14,047
  • 24
  • 80
  • 101
4
votes
1 answer

'Cannot convert the "System.__ComObject" value ...' error in PowerShell

I am trying to convert the following C# code to PowerShell (I have left out the parts of the code that I do not think are relevant): C# System.Type t = System.Type.GetTypeFromProgID("VisualStudio.DTE.10.0", true); object obj =…
Patrick
  • 147
  • 1
  • 15
4
votes
1 answer

InvalidCastException, QueryInterface call failing on COM component

I'm trying to use PCAnywhere's Ole automation in a .net applicaction I'm currently developing (VS 2010, c#). PCA 12.5 comes with a couple tlb files that when I try to add as references through VS I get an error on both saying 'A reference to…
rhyek
  • 1,790
  • 1
  • 19
  • 23
4
votes
1 answer

What is the proper way for an ActiveX (COM) control to clean up when closed by its parent?

I'm having problems with my .net controls not getting cleaned up properly when wrapped for ActiveX use. The default behavior leaves the SDK's test container app (TstCon32.exe) running as a GUIless process when I try and close it. The workaround I…
4
votes
1 answer

Packaging IDispatch Invoke with Parameters in C# (with DISPPARAMS)

I'm using Invoke for late binding on a legacy COM objects that supports IDispatch. This seems necessary as .NET's Type.GetMethod Type.InvokeMember do not seem to work on these objects. The following code works fine for getting a property from an…
Mister Cook
  • 1,552
  • 1
  • 13
  • 26
4
votes
5 answers

What is the correct type in c\c++ to store a COM's VT_DECIMAL?

I'm trying to write a wrapper to ADO. A DECIMAL is one type a COM VARIANT can be, when the VARIANT type is VT_DECIMAL. I'm trying to put it in c native data type, and keep the variable value. it seem that the correct type is long double, but I get…
SHR
  • 7,940
  • 9
  • 38
  • 57
4
votes
0 answers

Passing a COM object from C# to Perl using PerlNET

I’m trying to pass a COM object from C# code to Perl. At the moment I’m wrapping my Perl code with PerlNET (PDK 9.4; ActiveState) and I have defined a simple subroutine (+ required pod declaration) in Perl to pass objects from C# to the wrapped Perl…
Miriam
  • 41
  • 3
4
votes
3 answers

Building a COM object vtable in x86 assembly

I am building a COM object in x86 assembly using NASM. I understand COM quite well and I understand x86 assembly pretty well, but getting the two to mesh is getting me hung up... (by the way, if you're thinking of attempting to dissuade me from…
Miquella
  • 1,074
  • 2
  • 13
  • 25
4
votes
1 answer

Creating COM using ATL in C++ from VS2012

Trying to create simple COM library using ATL in Visual Studio 2012. I do: New ATL Project Welcome to the ATL Project Wizard Next Application Settings - no change (DLL) Next Finish Got a lot of files: Trying to understand where to add…
vico
  • 17,051
  • 45
  • 159
  • 315
4
votes
1 answer

_pAtlModule pointer is null when i try to CreateInstance using the CComObject function

I am working on the OPC(OLE process Control)Client program,with the asynchronous CALLBACK methods to get data from PLC using the KepServer.But I encountered the issue: CComObject* pCOPCDataCallback; // Pointer to Callback…
liyang
  • 41
  • 1
  • 8
4
votes
1 answer

Does .NET define common HRESULT values?

I'm creating a COM class in C#, which will be called from unmanaged C++. I want to use ThrowExceptionForHR but I'd rather not have to hard-code HRESULT numeric values. I was expecting there would be some enum of common HRESULT values in .Net…
Mr. Boy
  • 60,845
  • 93
  • 320
  • 589
4
votes
3 answers

float to _bstr_t

I know I can create a _bstr_t with a float by doing: mValue = _bstr_t(flt); And I can format the float string by first declaring a c string: char* str = new char[30]; sprintf(str, "%.7g", flt); mValue = _bstr_t(str); I am a bit rusty on c++,…
maxfridbe
  • 5,872
  • 10
  • 58
  • 80
4
votes
2 answers

how to connect to an open window of internet explorer using c#?

Can you use COM/OLE in a C# program to connect to a running instances of internet explorer? Ideally I'd like to find the URLs of all webpages open in IE.
Evan
  • 4,450
  • 10
  • 40
  • 58
4
votes
2 answers

Expose a class as STA COM

I have a little c# class that I need to expose as COM. THe tool that will use the COM object requires that I support STA. Is there anything special that I need to do with my COM object? (I know about the STAThread attribute, but (unless I'm wrong)…
JMarsch
  • 21,484
  • 15
  • 77
  • 125
4
votes
1 answer

How to isolate a bad COM component (HP Quality Center 10.0) from a .Net application when performing integration tests

I'm currently working on some .Net based software (.Net Framework 3.5 SP1) that integrates with HP Quality Center 10.0 through it's COM Client API (often referred to as TDApiOle80 or TDApiOle80.TDConnection). We are using XUnit 1.6.1.1521 and Gallio…
Bittercoder
  • 11,753
  • 10
  • 58
  • 76