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

Error 'Unable to cast COM object of type' when crossing thread apartments in C#

I've been working with a third party SDK as a referenced dll from within C# using .NET 4.5.2 on Windows 10. The IDE creates an Interop around the dll and I can see the appropriate namespaces, interfaces, enum, etc. The SDK I am working with is for…
Geo...
  • 307
  • 2
  • 14
4
votes
5 answers

Powershell: Using jQuery through InternetExplorer.Application

I followed this article, explaining how to spice up an Internet Explorer COM-Object with jQuery. While the author used Python, I want to do something similar in Powershell. Right now I have this code: function addJQuery ($browser) { …
raphinesse
  • 19,068
  • 6
  • 39
  • 48
4
votes
2 answers

IPreviewHandler Unload COM Objects takes a long time and freezes the application

I am trying to use the IPreviewHandler interface to display a windows 7 like preview on a TPanel within my application. The issue arises when I am destroying the preview object by calling Unload (which is meant to dispose of the COM objects) and…
MBass
  • 63
  • 4
4
votes
1 answer

SysAllocString/SysFreeString COM functions require CoInitialize to be called?

Is it required for COM to be initialized to use SysAllocString, SysFreeString and other BSTR handling functions? The MSDN says You need to initialize the COM library on a thread before you call any of the library functions except CoGetMalloc It…
djsoft
  • 1,051
  • 8
  • 19
4
votes
2 answers

Python differences between running as script and running via interactive shell

I am attempting to debug a problem with a ctypes wrapper of a windows DLL and have noticed differences when I run tests via an interactive shell (python or ipython) and when I run the scripts non-interactively. I was wondering if there is any…
pisswillis
  • 1,569
  • 2
  • 14
  • 19
4
votes
5 answers

What is the Equivalent of "object of C# " in VC++?

In C# we have a datatype object which can hold any type of data. Same thing I want to achieve in VC++. Can anyone kindly let me know VC++ equivalent of "Object of C#". IN C#, in the calling appl program (say call.cs) object…
codeLover
  • 3,720
  • 10
  • 65
  • 121
4
votes
1 answer

COM Add-in: Resolve the error DisconnectedContext in WinWord.exe

I built an add-on to Microsoft Word. When the user clicks a button, it runs a number of processes that export a list of Microsoft Word documents to Filtered HTML. This works fine. Where the code falls down is in processing large amounts of files.…
Bill
  • 582
  • 1
  • 7
  • 21
4
votes
1 answer

.NET equivalent of Delphi IStream initialization

I have the following Delphi code: var Stream: TMemoryStream; StreamI: TStreamAdapter; OleStream: IStream; begin Stream:= TMemoryStream.Create; Stream.LoadFromFile(filename); StreamI:= TStreamAdapter.Create(Stream, soOwned); …
SharpAffair
  • 5,558
  • 13
  • 78
  • 158
4
votes
2 answers

Which is the proper way to work with LateBinding in Delphi?

actually i am using late-binding in delphi, and i need to know wich is the proper way to work with it. My principal concern is about how I handle the memory used by these objects, I must free the memory? check this sample code var chEaten:…
Salvador
  • 16,132
  • 33
  • 143
  • 245
4
votes
1 answer

Volume Shadow Copy in C++

I'm developing an application which will need to copy files that are locked. I intend on using the Volume Shadow Copy service in Windows XP+ but I'm running into a problem with the implementation. I am currently getting E_ACCESSDENIED when…
JWood
  • 2,804
  • 2
  • 39
  • 64
4
votes
3 answers

Using 32-bit COM object from C# or VBS on Vista 64-bit and getting error 80004005

I need some mind reading here, since I am trying to do what I do not completely understand. There is a 32-bit application (electronic trading application called CQG) which provides a COM API for external access. I have sample programs and scripts…
alexandroid
  • 1,469
  • 2
  • 15
  • 32
4
votes
3 answers

COM-Interop: Change .NET Framework Version from 2.0 to 4.0 - Should I change the Guids also?

I like to migrate a COM-Class from 2.0 to 4.0. Would you recommend also to generate new guids for the classes and a different ProgId? The old Class would not be used anymore. I know I have to re-register the Class, for the new Path of the…
Summer-Time
  • 1,824
  • 15
  • 19
4
votes
2 answers

How can I query a .pdb file in PowerShell?

From Querying the .Pdb File I can see that there is a COM interface to access the contents of a .pdb file. Now, how would I access that interface from PowerShell? I know I need to use New-Object -ComObject ... but I don't know what I need to…
Adrian
  • 10,246
  • 4
  • 44
  • 110
4
votes
1 answer

Functional way of handling resource clean up in F#

Hi this is an exmaple of how C# language handles Com interop resource management. orginal source : Excel.Application app = null; Excel.Workbooks books = null; Excel.Workbook book = null; Excel.Sheets sheets = null; Excel.Worksheet sheet =…
casbby
  • 896
  • 7
  • 20
4
votes
2 answers

How to do a simple mail merge in OpenOffice

I need to do a simple mail merge in OpenOffice using C++, VBScript, VB.Net or C# via OLE or native API. Are there any good examples available?
1800 INFORMATION
  • 131,367
  • 29
  • 160
  • 239