Link to home
Start Free TrialLog in
Avatar of jlvill
jlvill

asked on

Using TLB file in Delphi

Hi,
I have a TLB file, I already import into Delphi.
(Not Imported from DLL files but created with IDL file)

I know the DLL link with the IDL file.
 I want use function, but I can't. I suppose than I should absolutely make the link with the Dll.

But how ... Somebody can help me ?
Avatar of esoftbg
esoftbg
Flag of Bulgaria image

Example:

interface
 
//........

  function FunctionName(....): Longint; cdecl; external DLLNAME;

implementation

function TForm1.Function_Delphi(....): Longint;
begin
  Result := FunctionName(....);
end;
Avatar of jlvill
jlvill

ASKER

Hi Eso,
Probably my question is not clear enough or maybe I don't understant very well the example you gave me...
I know how to link any function with a DLL but I don't know how use mu TLB file. I can read this note into my TLB file.
// NOTE:                                                                      
// Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties  
// which return objects that may need to be explicitly created via a function
// call prior to any access via the property. These items have been disabled  
// in order to prevent accidental use from within the object inspector. You  
// may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively  
// removing them from the $IFDEF blocks. However, such items must still be    
// programmatically created via a method of the appropriate CoClass before    
// they can be used.

I have the UUID 9X99XXX9-9999X-99X9-....-............ (EXAMPLE) and I presume that
Registry
DLL file
TLB file
Pas file
are linked between them but I don't know how ?

Maybe it's more clear like that,

JL
Avatar of jlvill

ASKER

Hi Guys!

Let me precise my problem,
I use the MIDL compiler (Microsoft IDL Compiler).
I succeed to compile a IDL file to obtain a TLB file.


[uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx),
 helpstring("IDLFILE 1.0 Type Library"),
 lcid(0x0C0C),
 version(1.0)
]
library IDLFILE
{
      * * *
IDL File
      * * *    
}


I have imported TBL file into Delphi to have TLB.Pas. I have no class or coclass into the TLB file. So how can I use it.

Maybe I didn’t use the good options. So, have you an idea to use the idl file.

JL
ASKER CERTIFIED SOLUTION
Avatar of OzzMod
OzzMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial