Posts

Showing posts with the label VB6

Creating .Net COM objects for interop with VB6

.Net has some nice tools to help you create COM objects. .Net COM objects are slightly different from regular that regular COM objects in that the .Net is still in its intermediate language form. Because of this, you cannot register a .Net COM object with "regsvr32" as usual, you must use "regasm", which comes with the .Net framework. There are a few project properties that in Visual Studio that will do a lot of the work for you. First, create a standard class library project, or open an existing one. Go to the project properties and change the following settings. On the "Application" tab, click the "Assembly Information" button. Check the box to "make assembly com-visible". This option will wrap your library as a COM library. Next go to the "Build" tab and check the box to "Register for COM interop". This option will automatically register the output dll with regasm on the current machine after a build. The final, o...