9 votes
Accepted

Find installed and available Windows Updates

Loop like a native I suggest you have a look/read at Ned Batchelder's excellent presentation "Loop like a native". In your case, any time you write: ...
SylvainD's user avatar
  • 29.2k
4 votes

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

OnConnection and OnStartupComplete I can forsee a problem arising. Assume the addin is started with ext_ConnectMode.ext_cm_AfterStartup then in the ...
Heslacher's user avatar
  • 50.4k
4 votes

Wrapping COM objects with IDisposable

Just a flying review: Have you tested this? The equality code isn't at all right. Firstly, never override == and != without ...
RobH's user avatar
  • 16.9k
4 votes
Accepted

Wrapping COM objects with IDisposable

There is two things that caught my attention. Every public method / property of all implementing classes needs to call ThrowIfDisposed(). Always. That's the ...
Vogel612's user avatar
  • 25.2k
4 votes
Accepted

Not so Excellent Knight's Tour

As you mention, some of this is messy and haphazard, which is a side-effect of writing one-off scripts that have a single behavior they need to perform, instead of something extensible. In that case, ...
Dan Oberlam's user avatar
  • 7,804
3 votes

A generic IEnumerator to enumerate COM collections

You rarely need to manually implement enumerators. In your case, you should probably just go with extension methods. For example: ...
Nikita B's user avatar
  • 13k
3 votes
Accepted

A generic IEnumerator to enumerate COM collections

Your ComWrapperEnumerator is generic in two types without needing to. You don't really care about TComCollection aside that it ...
Bruno Costa's user avatar
  • 5,566
3 votes
Accepted

A status bar for the VBE

By adding a small nesting inside the first if statement you can skip the multiple checks for declaration != null which would ...
Heslacher's user avatar
  • 50.4k
3 votes
Accepted

IDTExtensibility2 implementation for Rubberduck's entry point

The code that handles the methods OnConnection, OnStartupComplete, OnBeginShutdown and OnDisconnection and their flags is correct. I cannot comment on root composition or NInject. Some things worth ...
Carlos Quintero's user avatar
2 votes

Wrapping COM objects with IDisposable

The wrapped object reference might be null Then there's a bug right here: ...
Mathieu Guindon's user avatar
2 votes
Accepted

Milking a COM type library: "fun" with COM reflection

I think you can make this a tiny bit clearer: ...
RobH's user avatar
  • 16.9k
2 votes

SAFEARRAY export from a C++ DLL to VBA

Formatting Notice that I "wrapped" a lot of code in single lines to save some time to the processor going through them... I know it's not conventional, but I'm really looking to speed this up the ...
Jerry Coffin's user avatar
  • 33.5k
2 votes
Accepted

Automating the download of a GitHub repo

I hope to have more for you but a couple of things to get started. Verbose, Debug, Information I am very happy to see you using these cmdlets for different levels of information output to the user. ...
Matt's user avatar
  • 2,568
2 votes

Properly destroying the VBE

...
Malachi's user avatar
  • 28.6k
2 votes

Simple python COM server to expose scipy integration to VBA

Deferred Imports Why is import win32com.server.register only imported during __main__? It should be inexpensive and clean to ...
Reinderien's user avatar
  • 61.9k
1 vote
Accepted

Low Level VBA Hacking - making Private functions Public

...
Greedo's user avatar
  • 2,345
1 vote
Accepted

Getting hard-drive serial number on Windows

if (FAILED(hres)) return ::std::nullopt; svc.reset(pSvc); It bothers me that this is repeated, and more generally, you need boilerplate to use one of the COM ...
JDługosz's user avatar
  • 11.3k
1 vote

Create Word Document in C++

First off, I think it's worth thinking carefully about whether C++ is the best tool for this task. It certainly can be done, but you may find better documentation/more support for COM/interop from C# ...
sudo rm -rf slash's user avatar
1 vote

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

Intro If you're new to VB.NET programming then I advice you to read up on "compile settings" and especially the strict option as this defaults to Off. Anything ...
Bjørn-Roger Kringsjå's user avatar
1 vote

Using COM objects in plain C

The code is very well written, and very clear, easy to maintain. I am using a later version of Visual Studio Professional (Visual Studio 2019) and there are warning messages about all of the calls to <...
pacmaninbw's user avatar
  • 23.8k

Only top scored, non community-wiki answers of a minimum length are eligible