1) COM server component named "LoaderServer" -
consists of a public class LoaderClass with Initialize() method that actually
loads .NET assembly named "DotNet". I additionally referenced an
assembly file "DotNet.dll", as per your suggestion, and changed parameter of
[Assembly].Load method to assembly display name:
Imports
size=2> System.Reflection
<ComClass(LoaderClass.ClassId,
LoaderClass.InterfaceId, LoaderClass.EventsId)> _
Public
size=2> Class
LoaderClass
#
size=2>Region "COM GUIDs"
Public Const
size=2> ClassId As
String =
"5B5EBDA2-7A4E-45F8-9CA1-CE61435197CA"
Public Const
size=2> InterfaceId As
String =
"A3747BA4-DC24-4239-BF8C-7005272AA365"
Public Const
size=2> EventsId As
String =
"A9EB5F72-B513-4EE3-9A0E-5BBA2CB29BCB"
#
size=2>End
size=2>Region
Public
size=2> Sub
color=#0000ff size=2>New()
MyBase.New()
End
Sub
Public
size=2> Sub
Initialize()
[Assembly].Load("DotNet")
End
Sub
End
Class
2) There is also a Startup application
called "Startup.exe" that fires ACAD up and initializes COM server via
GetInterfaceObject() call:
size=2>Imports
Autodesk.AutoCAD.Interop
size=2>Module Startup
color=#0000ff size=2>Sub
Main()
color=#0000ff>
size=2>Dim oACAD
size=2>As
Autodesk.AutoCAD.Interop.AcadApplication
size=2>oACAD = New
size=2>
Autodesk.AutoCAD.Interop.AcadApplication
size=2>
color=#0000ff>
size=2>Dim o
size=2>As
size=2>Object
face="Courier New">
color=#000000> o =
oACAD.Application.GetInterfaceObject("LoaderServer.LoaderClass")
face="Courier New" size=2>
face="Courier New"> End
size=2>Sub
color=#0000ff size=2>
size=2>End
size=2>Module