I am using Delphi 7 to try to use a .DLL created by VB.net. When I run TDUMP.EXE on the .DLL, it reports no exported data available. The VB.Net .DLL uses "RaiseEvent" to return data.
Any help would be usefull.
Thanks
I am using Delphi 7 to try to use a .DLL created by VB.net. When I run TDUMP.EXE on the .DLL, it reports no exported data available. The VB.Net .DLL uses "RaiseEvent" to return data.
Any help would be usefull.
Thanks
You first need to run regasm from visual studio command prompt for example, and make it generate type library for your assembly:
regasm YourLib.dll /tlb:TypeLib.tlb
Now you have TypeLib.lib
in the same directory that YourLib.dll
is. Copy both to your Delphi project folder (where exe will be built).
Then in Delphi go to: Project->Import Type Library -> Add -> (locate and select TypeLib.lib) -> Create unit
In uses add "ComObj" and "YourLib_DLL" (this will be the name of your dll).
And then you can use all the classes that are inside the DLL as you could in VB only now if the class was named Point in VB, now it will be called TPoint...
OK....I got the .tlb created as instructed. This is all that is in it:
// ***************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:
// Type Libraries : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Non-DISP interfaces: IID_xxxx
// ***************************************//
const
// TypeLibrary Major and minor versions
FetcherMajorVersion = 1;
FetcherMinorVersion = 0;
LIBID_Fetcher: TGUID = '{2E3B99DB-019A-4857-A03F-A40D418FF3BC}';
implementation
uses ComObj;
end.
Also....you said to add ComObj and Yourlib_dll (this will be the name of your dll). in the uses statement. I can't get it to accept anything .DLL