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
0 votes
0 answers
22 views

Beginner with COM, bringing window to front using UI Automation

Assuming, that CoInitialize() was called in main.cpp as one of first things, is that the proper usage of COM? I don't have too much experience with this technology... I include the whole class' ...
user avatar
  • 141
11 votes
0 answers
232 views

Low Level VBA Hacking - making Private functions Public

NEW: Download demo files Not sure what to title this - essentially, inspired by RubberDuck's unit test engine, I've created a way to call private methods of standard modules in VBA. It also lets you ...
user avatar
  • 2,050
6 votes
1 answer
211 views

Simple python COM server to expose scipy integration to VBA

I want to create a COM server to expose scipy to VBA code, as performing integration is kinda difficult and I don't know of any good VBA/COM libraries for this. My objectives are: As portable as ...
user avatar
  • 2,050
2 votes
1 answer
109 views

Getting hard-drive serial number on Windows

The point is to get the serial number of one of the hard drives on Windows. My code is based on an example from MSDN. I tried to make it an exception-safe, self-contained function. It works, to the ...
user avatar
2 votes
1 answer
256 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. ...
user avatar
3 votes
0 answers
217 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 ...
user avatar
  • 625
12 votes
1 answer
206 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-...
user avatar
  • 12.7k
2 votes
0 answers
222 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 ...
user avatar
  • 191
2 votes
0 answers
58 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: ...
user avatar
3 votes
1 answer
754 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 ...
user avatar
1 vote
0 answers
110 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 ...
user avatar
  • 111
10 votes
1 answer
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 ...
user avatar
11 votes
1 answer
187 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 ...
user avatar
7 votes
2 answers
413 views

A generic IEnumerator to enumerate COM collections

As I wrapped the VBIDE API, I encountered a number of "collection types" (Windows, CodePanes, ...
user avatar
9 votes
3 answers
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 ...
user avatar
4 votes
1 answer
275 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 ...
user avatar
12 votes
1 answer
497 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 ...
user avatar
  • 1,961
10 votes
1 answer
6k 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) ...
user avatar
  • 203
8 votes
1 answer
297 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 ...
user avatar
4 votes
1 answer
238 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 ...
user avatar
  • 243
1 vote
0 answers
62 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 ...
user avatar
  • 131
7 votes
1 answer
436 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 ...
user avatar
16 votes
5 answers
322 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 ...
user avatar
25 votes
2 answers
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 ...
user avatar
3 votes
1 answer
818 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 ...
user avatar
  • 1,497
4 votes
3 answers
66 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 ...
user avatar
3 votes
1 answer
558 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 ...
user avatar
12 votes
1 answer
267 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 ...
user avatar
7 votes
2 answers
2k 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. ...
user avatar
  • 191
7 votes
1 answer
197 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-...
user avatar
15 votes
2 answers
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 ...
user avatar
6 votes
2 answers
7k 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, ...
user avatar
  • 61
6 votes
1 answer
3k 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 ...
user avatar
  • 461
2 votes
1 answer
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 ...
user avatar
2 votes
1 answer
979 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. ...
user avatar
  • 153
2 votes
1 answer
308 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 <...
user avatar
4 votes
1 answer
12k 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 ...
user avatar
  • 191
4 votes
1 answer
692 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 ...
user avatar
2 votes
0 answers
98 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? ...
user avatar
  • 576
4 votes
2 answers
1k views

C++ code to launch a Windows 8 app

This is my first C++ in many years. It's based on some stuff I found on the internet, including a Microsoft article on a similar topic. But I'm sure there are C++ idioms that might make this better or ...
user avatar
  • 253