Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with conversion of variant

Status
Not open for further replies.

DarkRavenM

Programmer
Mar 4, 2009
7
0
0
MX
Hi all, im having this problem, i have a component in Visual Basic from a dll, i installed it in Delphi, the problem is that this component in Visual Basic returns a Data Type of Collection, and Delphi doesnt recognise this type so i assigned it to a variant type, when i check the data type of the variant it says that is a varDispatch, can someone help me get the information from the Dispatch cuz i've never used it, im basically trying to convert the dispatch to a stringlist or an array something that i can work with, i cant put the dll file here cuz it has a license.
 
vardispatch is in fact a reference to an automation object. this means that the collection is a COM interface for delphi. did you try to import the DLL into delphi? delphi supports activex libraries and will automatically generate the COM wrapper for you...

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Ye, its already installed in Delphi, but i dont have an idea on how no manipulate the vardispatch on delphi
 
I assume it is an OCX library and it should pose no problems in delphi. what is the name of the vb component? maybe I can try it out...

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
its dia component

this is the code i have, TclsTarifa is the component i installed


unit UDia;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleServer, DIA7Consulta_TLB;

type
TForm1 = class(TForm)
objDia: TclsTarifa;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }

end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
info:variant;
dispatch:idispatch;
begin
objDia.Ruta:='C:\Program Files\DIA';
objDia.Codigo:='15091001';

if objDia.Actualiza(TRUE) then
begin
dispatch:=objDia.CuotasC;
int:=objDia.CuotasC;
end;
end;

end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top