tags:

views:

105

answers:

1

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??

+2  A: 

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;
Robert Love
do you mean here??/ *********************************************************************//// GUIDS declared in the TypeLibrary. Following prefixes are used: // Type Libraries : LIBID_xxxx // CoClasses : CLASS_xxxx // DISPInterfaces : DIID_xxxx // Non-DISP interfaces: IID_xxxx
ml
It's right before the implementation section of the unit.
Robert Love
i try like thisvar M : IImage2Disp;begin M := TIRSDK.Create;// here i have , ot enough actual parameters Why?? M.TempUnit:= 1000;end;Thank´s
ml
I´starting so what is the simple way to call:*********************************************************************//// DispIntf: IImage2Disp// Flags: (4416) Dual OleAutomation Dispatchable// GUID: {D9DC4473-CCB9-46FF-A063-4D72B8495F29}// *********************************************************************//IImage2Disp = dispinterface['{D9DC4473-CCB9-46FF-A063-4D72B8495F29}']property TempUnit: Smallint dispid 24;property TempUnitStr: WideString readonly dispid 25;property DistUnitStr: WideString readonly dispid 26;
ml
I try to get the value from the dll but gave me a erros and stopprocedure TForm8.Button2Click(Sender: TObject);varIntf: IImage2; begin iRSDK1.Connect; edit1.Text := Intf.OutputUnitStr;end;what i´m doing wrongMl
ml
Intf has not been created when you are using it. iRSDXK1 may also be in the same boat.
Robert Love
I+m tryng but really not yet found the solution is somenoe can helpmy source with DLL is herehttp://www.4shared.com/file/thBMxY2G/carregactx.html
ml