I am trying to access a .NET assembly (Position.dll) in Delphi by importing it as a COM type library. Everything seems to import OK, but the resultant Position_TLB.pas file only contains functions to create the classes. None of the class methods or delegates are imported.
Here’s what I do.
1) Add the Position.dll assembly into the GAC.
gacutil.exe -i Position.dll
2) Register the assembly
regasm.exe Position.dll
3) Import the assembly into Delphi as a Type Library
All the imported classes look something like this:
IID__MyClass: TGUID = '{F53EAE3D-9EB8-1111-B1F7-5DB609FDBEAE}';
CLASS_MyClass: TGUID = '{E15581CD-FFF5-34CE-3434-D5484798900F}';
...
_MyClass = interface;
_MyClassDisp = dispinterface;
MyClass = _MyClass;
// *********************************************************************//
// Interface: _MyClass
// Flags: (4432) Hidden Dual OleAutomation Dispatchable
// GUID: {F53EAE3D-9EB8-1111-B1F7-5DB609FDBEAE}
// *********************************************************************//
_MyClass = interface(IDispatch)
['{F53EAE3D-9EB8-1111-B1F7-5DB609FDBEAE}']
end;
...
// *********************************************************************//
// DispIntf: _MyClassDisp
// Flags: (4432) Hidden Dual OleAutomation Dispatchable
// GUID: {F53EAE3D-9EB8-3538-B1F7-5DB609FDBEAE}
// *********************************************************************//
_MyClassDisp = dispinterface
['{F53EAE3D-9EB8-1111-B1F7-5DB609FDBEAE}']
end;
...
// *********************************************************************//
// The Class CoMyClass provides a Create and CreateRemote method to
// create instances of the default interface _P2100 exposed by
// the CoClass P2100. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoMyClass = class
class function Create: _MyClass;
class function CreateRemote(const MachineName: string): _MyClass;
end;
...
class function CoMyClass.Create: _MyClass;
begin
Result := CreateComObject(CLASS_MyClass) as _MyClass;
end;
class function CoMyClass.CreateRemote(const MachineName: string): _MyClass;
begin
Result := CreateRemoteComObject(MachineName, CLASS_MyClass) as _MyClass;
end;
MyClass should contain several methods and delegates that are nowhere to be seen in the TLB file.
Here’s what I see if I try code completion on the class:

Am I missing something obvious?
i’ve encountered that too. You are unfortunately limited to what has been added to the embedded type library.
It’s not Delphi’s “fault”, and there’s nothing you can do to fix it.
Unless you want to create your own managed DLL, that knows how to call the managed methods of this other managed library, and you expose them yourself to COM.
Then the correct task is to use registration-free COM of the dll so that you don’t have to force your users to register your COM/managed dll.
We’ve done it with Microsoft Great Pains. We create our own
.dllin Visual Studio that knows how to call the managed Great Pains code. Then expose all those methods to COM.