В Vb есть Class Library:
///////////////////////////////////////////////////////////////////////////////////////
Imports System
Imports System.Reflection
<Assembly: AssemblyKeyFile("D:\...\MyKeys.snk")>
<Assembly: AssemblyVersion("1.0.0.0")>
Namespace SimpleLib
Public Interface ISimpleInt
Function Mul(ByVal x As Integer, ByVal y As Integer) As Integer
ReadOnly Property About() As String
End Interface
Public Class SimpleClass Implements ISimpleInt
Public Function Mul(ByVal x As Integer, ByVal y As Integer) As Integer Implements ISimpleInt.Mul
Mul = x * y
End Function
Public ReadOnly Property About() As String Implements ISimpleInt.About
Get
Return "This component is written in Visual Basic.NET"
End Get
End Property
End Class
End Namespace
///////////////////////////////////////////////////////////////////////////////////////
В Delphi7 есть код:
unit Simple;
uses
...
ComObj;
procedure Execute();
var
Res: Integer;
SimpleClass: ISimpleInt;
begin
SimpleClass := CoSimpleClass.Create;
Res := SimpleClass.Mul(3, 3);
end;
end.
///////////////////////////////////////////////////////////////////////////////////////
СООБЩЕНИЕ КОМПИЛЯТОРА
Incompatible types: '_SimpleClass' and 'ISimpleInt'
///////////////////////////////////////////////////////////////////////////////////////
Примечание
Type Library я создал в текущей дир. и класс зарегистрировал
>RegAsm.exe Name.dll /tlb
Cмотри статью:
http://www.blong.com/Articles/DotNetInteropD8/Interop2/COMNetInterop.htm