Environment: Win7, Delphi 2010
I have .NET assembly with needed classes and interfaces.
I see the assembly is installed with gacutils.exe.
Interop.CNHVoyager2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5162c9617d11c099, processorArchitecture=x86
the main problem is the assembly does not provide COM-interface.
Is it possible to get access to classes and interfaces inside the assembly from Delphi?
I try so:
procedure TCardReader.InitDotNetAssemblyLibrary;
var
card: ICNHV2Card;
hr: HRESULT;
NetClassName: WideString;
begin
NetClassName := 'CNHVoyager2.CNHV2Card, Interop.CNHVoyager2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5162c9617d11c099, processorArchitecture=x86';
hr := ClrCreateManagedInstance(PWideChar(NetClassName), StringToGUID('{155EF4F5-AA34- 4FF4-8EEA-DC4223DF139C}'), card);
OleCheck(hr);
end;
And I get a message:
Class is not registered.
The .NET dll is in the project's folder and is registered from the location.
Is it possible at all?
UPDATE: As David said I have checked the existing wrapper. And I found Item exported TLB file from it and see inside of it now:
_foDevice = interface(IDispatch)
['{E21BD447-D9D6-4E40-9A5E-244AEC7CE979}']
function ReadFileDirect(const oDriver: IfoFODD; const sFolder: WideString;
const sFilename: WideString): IfoSummary; safecall;
end;
So I can read needed data file. But I need IfoFODD driver interface to do it. In the TLB I can not see it. And I think it is inside the .NET not-com-assembly which is the driver by nature. Can I make some like disassemble to take the interface? Or is it another (correct) way to use it?