ml.
ml.

Reputation: 163

working with dll ocx in delphi

i´m trying to use 2 a dll (OCX) in my application but when i want to call a function how can i do soo?

how can i call this funcion RSDKLib_TLB.IID_IMeasurement.... "TGUID"???

in the dll is

 IID_IMeasurement: TGUID = '{97E75BE0-AF26-4E4A-B651-C5DDECEC2936}';

or is the approach wrong??

Upvotes: 1

Views: 2018

Answers (1)

Robert Love
Robert Love

Reputation: 12581

Sounds like you may need some basic introduction to COM Programming.

It sounds like you have imported the library. But you need to learn how to call the functions that holds.

First off look at the bottom of the import unit (right above the implementation keyword) you will find several classes named CoXXX where XXX is usually the name of the interface you want to create.

The CoXXX Classes will look like this:

  CoXXX = class
    class function Create: IXXX;
    class function CreateRemote(const MachineName: string): IXXX;
  end;

So taking a guess at the information you have provided.

var
 M : IMeasurement;
begin
 M := CoIMeasurement.Create
 M.MethodYouNeedToCall;
end;

Upvotes: 2

Related Questions