Questions tagged [com]

Component Object Model (COM) is a component technology from Microsoft, featuring remoting, language independence and interface-based programming.

Filter by
Sorted by
Tagged with
25
votes
2answers
5k views

Hooked on Windows

The code that was just added to Rubberduck will allow us to set up hotkeys for our features, so that next release, Ctrl+Shift+R brings up the refactor/rename dialog, for example. The requirements ...
16
votes
5answers
280 views

Step by Step, ooh HotKey

Still hooked on Windows, I refactored the hook into a number of interfaces, and I wanted to support 2-step hotkeys, so I started with defining an IHook that can be ...
15
votes
2answers
2k views

Passing a 1D array (single column of a Range object) to .NET to manipulate it without loops and returning it back to VBA

Background Kind of a follow up - slightly related to my other SO question. I thought that if somehow I find a way in VBA to pass a single column to .NET and convert it to a native .NET type then I ...
12
votes
1answer
263 views

Inspector Rubberduck

Our Rubberduck open-source VBE add-in project is coming along nicely. One of the main features we're going to be implementing in the next release, is code inspections. I started by defining an ...
12
votes
1answer
132 views

Not so Excellent Knight's Tour

Note: This is part of a set of demo applications I'm writing for colleagues to show we're not limited to VBA when dealing with Excel. Considering our IT challenges (no admin on-site & no local-...
12
votes
1answer
370 views

Shared VB6 *and* VBA extensibility add-in with OnConnect and OnDisconnect handling

Rubberduck works well enough when the VBE is of the VBA variety, but it currently only works when the Rubberduck is configured to load at VBA start-up, and it has a tendency to crash the host ...
11
votes
1answer
175 views

Properly destroying the VBE

The disposable wrappers worked exactly as intended... and that turned out being a huge mistake: That's because the .net runtime creates a Runtime Callable Wrapper per-type, not per-instance*; it took ...
10
votes
1answer
5k views

Find installed and available Windows Updates

I have a function that uses Windows Update Agent (WUA) API through COM using the win32com.client module, part of pywin32 package for retrieving the installed and the available (not yet installed) ...
10
votes
1answer
1k views

Automating the download of a GitHub repo

This script is designed to locate and download the first repository in your sidebar on the GitHub repository page. It downloads the .zip file for that repo and saves it to the default location. I ...
9
votes
3answers
1k views

Wrapping COM objects with IDisposable

One of the things believed to contribute to destabilizing Rubberduck 2.x, is the fact that a lot of COM object references are stored in many places, and ...
8
votes
1answer
293 views

A status bar for the VBE

One of the most annoying things about the VBE (VBA's IDE), is that it doesn't have a status bar. Rubberduck 2.0 works around this by introducing the ...
7
votes
2answers
1k views

Tuning Excel calculation engine which uses MS Excel interop

I am currently building an Excel calculation engine. Its purpose is basically to wrap the calculation logic of an Excel workbook in order to use the logic from a C# library. ...
7
votes
2answers
407 views

A generic IEnumerator to enumerate COM collections

As I wrapped the VBIDE API, I encountered a number of "collection types" (Windows, CodePanes, ...
7
votes
1answer
401 views

Milking a COM type library: “fun” with COM reflection

Once upon a time, there was a duck that wanted to know where and how user code was calling into the VBA standard library and Excel object model. To match the rest of its API, the poor little duck had ...
7
votes
1answer
188 views

Integrating Unit Testing functionality into an old COM-based IDE

My UnitTesting add-in works nicely, but it has dependencies on a Reflection and a System add-...
6
votes
2answers
6k views

C++ application calling C# Dll marshalling strings

The code appears to work fine. The values are returned as expected from the DLL and the values are added correctly to the DLL. Will the way I am passing the string to C# cause a memory leak? Also, ...
6
votes
1answer
2k views

C++ Wrapper for SAFEARRAY

Here is a C++ wrapper for SAFEARRAY, including the ability to expose it as a VARIANT, and to create one out of VARIANT. I am aware of CComSafeArray, however i don't use VC++ so I do not have ...
4
votes
3answers
65 views

COMpatible+ Google+ Integrations+ Scoping+

So I have part of a library which deals with scopes in Google+ integration, and I'm curious on the overall view of it. Yes, things are stringly typed in one of the methods, that is because this has ...
4
votes
1answer
11k views

Proper way of using IXMLDOMDocument

I am trying to use IXMLDOMDocument for XML reading/writing. I am not good COM, and I am not aware that I am doing things right or wrong. I am very unsure that there could be some problems with COM ...
4
votes
1answer
230 views

IDTExtensibility2 implementation for Rubberduck's entry point

Here is the new & improved Rubberduck 2.x entry point class, based on MZ-Tools 8.0's Connect.VBA implementation of the ...
4
votes
1answer
655 views

Is brute force the accepted best practice for handling Excel COM 'busy' exceptions?

Following on from a question about handling-com-exceptions-busy-codes I would like to know if the following model is the accepted best practice of handling Excel COM busy messages when accessing the ...
4
votes
1answer
180 views

A class (actually a structure) to help decode an HRESULT

HRESULTs are the common way for Microsoft technologies like COM and Win32 to return either an error code or messages that mean a specific type of success. They are usually returned as the result of a ...
3
votes
1answer
522 views

Hook COM Object and get data from SIEMENS Step 7 software to control PLC through events in their code modified at runtime

I'm a first traveler coding in WinApi, Hooks, COM objects. Then, I made a dll to inject (EasyHook) this in the target SIEMENS Step7 process and modify the software code at runtime: Maybe I want some ...
3
votes
1answer
558 views

SAFEARRAY export from a C++ DLL to VBA

My code is not very elegant, but I'm a total newbie in c++ and I consider it already a major achievement that I managed to write something that actually works. As background, I'm defining in VBA the ...
3
votes
0answers
119 views

C# Dictionary Wrapper for VBA

I am a technical reviewer/writer and I use VBA for Word a lot to manage issues in Word documents I receive. I have frequently come across niggles when using Collections, Scripting.Dictionaries or ...
2
votes
1answer
931 views

Find password to a word document

I am using Java and COM4j to communicate with Word. The approach I used here is brute force. I have a password protected .doc, and I forgot its password. ...
2
votes
1answer
298 views

VARIANT structure deserialization code organization

In my project i work with COM object via System.Reflection. COM object returns pointer on structure VARIANT, that i cast as <...
2
votes
1answer
75 views

Create Word Document in C++

I am new to COM programming in C++ and while this code works welcome suggestions to improve readability/reliability. This creates a blank word document and adds the text Hello, World. ...
2
votes
0answers
146 views

(COM Callable) Python class to decompile *.chm file with Microsoft HTML Help Executable

Windows only. So I am writing code to decompile a Windows compiled html help file (*.chm) and then tidy the files found within. Whilst, I have blogged some simple Python examples I now want to ...
2
votes
0answers
55 views

Updating Excel sheet with information from a DataTable

Basically, I'm trying to update an excel sheet using a DataTable (The columns structure between the two are not the same) with respect to the following rules: ...
2
votes
0answers
712 views

Using COM objects in plain C

In this code, I am creating a COM object to programatically access internet explorer. In order to access this object's properties and methods, I am writing wrapper functions like ...
2
votes
0answers
97 views

D3D COM Object Pooling

I'm using the following pattern to pool D3D objects globally in my application. Is it a good idea (alternatives)? Is it thread-safe? ...
1
vote
1answer
2k views

Conversion between QString and BSTR

I'm currently working on a Qt project writing Excel files through a third party DLL. As the third party DLL has a COM interface, I have to do lots of conversions between QString and BSTR... I wrote ...
1
vote
0answers
97 views

Compact a file of 'Compound binary file format'

I am working on a modelling application written in C++ and MFC. The generated model is saved as a compound file. For various reasons, I need to compact the compound file therefore I decided to write a ...
1
vote
0answers
51 views

IDataConvert::Release() does not return 0

In order to convert a database type DB_NUMERIC to real, I noticed that a call to IDataConvert::Release() does not return ...