Search code examples
vb6mmc

Upgrading VB6 Code Built with Snap-In Designer


We have some old VB6 code that was apparently developed using something called the MMC Snap-In Designer. I'm having trouble finding the best path forward to restoring this project's functionality. For whatever reason it no longer works (I don't know why or when this happened). When MMC loads the MSC file, and the snap-in's node is selected, we just seen an error, "MMC could not create the snap-in." I personally don't even know what this snap-in is supposed to look like or do, so re-implementing it is going to be a challenge.

One path is to try to find the version of the platform SDK that I've heard tell contains this MMC Snap-In designer, download and install it, and see if looking at this project in the IDE gives any clues about how to make it work, or at least how it used to work. There's also the possibility of just identifying some missing registry entry that we may have somehow lost over time or as we transitioned to supporting a 64-bit OS (while most of our code still compiles to 32-bit binaries).

However, I would prefer to upgrade the VB6 project to something newer if there's any possibility of upgrading snap-in designer projects to whatever is being used today. I have no familiarity with this old Snap-In designer, but at least if we had some way of upgrading this code to something modern, I would be able to learn about snap-in development using currently available resources. Is there any upgrade path for these MMC Snap-In Designer projects?


Solution

  • Although I was not able to find an automated upgrade, I found that, at least in our case, manually rewriting the VB6 code for the MMC snap-in into VB.NET was relatively easy. This was partly due to the fact that the snap-in structure itself was quite simple, and partly due to the fact that all the functionality was in a separate DLL that was already VB.NET. I think the only helpful advice I have to pass along is that the VB6 code for the snap-in (even if you don't have the snap-in designer installed) can still be accessed via a text editor by loading the .DSR file and scrolling down a ways. I think the object model for implementing an MMC snap-in from .NET is rather different than the model used by the VB6 MMC snap-in designer, but the .NET model is pretty easy to deal with if you know what you need to accomplish. Just refer to the VB6 code in the DSR file for the pieces of code that aren't related to MMC, and use a higher level understanding of the design (not that code directly) to re-implement the purely MMC aspects of the project.