Any help would be highly appreciated!
Thanks.
> What are the steps necessary for early binding in Delphi 3?
1. You must have a typelib, either as a .tlb, or inside the .exe or
dll
2. Use Project | ImportTypelib to read the .tlb, .exe or .dll and
create a Delphi xxx_tlb.pas file.
3. Use the xxx_tlb unit in your code, and you'll have early binding.
This example shows early binding to the SQL Server DMO OLE interface.
SQLServer, Database and Table are all Interfaces defined in the
SQLOLE_TLB unit, created from \MSSQL\BINN\SQLOLE65.tlb
uses
SQLOLE_TLB;
var // all from the SQLOLE_TLB unit
FSQLServer: SQLServer;
Fdatabase: Database;
FTable: Table;
FSQLServer := coSQLServer.Create;
// two alternate ways to create the SQL Server object if there's no
coClass:
// FSQLServer := CreateComObject (Class_SQLServer) as SQLServer;
// FSQLServer := CreateOLEObject ('SQLOLE.SQLServer') as SQLServer;
FSQLServer.NetPacketSize := 8192;
with FSQLServer.Application.Properties do
For I := 1 to Count do
With Item(I) do
Memo1.Lines.Add (Format ('%s=%s', [Name, Value]));
Any suggestions?
Thanks
Ben
Scott Samet [TeamB] wrote in message ...
In early binding, by experiment, I found that you have to specify _all_
values in the function call and if you aren't actually using them you still
have to supply some value for each parameter --> i.e. parm1 := ''; parm2 :=
false: etc.
It makes sense since you don't have the compiler or the IDispatch interface
to scan the parameters. You are directly calling the object's function.
--
Gerry Pierce
======================================
When you come to a fork in the road, take it.
- Yogi Berra
======================================
Ben Geerdes wrote in message <69dhs5$ac...@forums.borland.com>...
var
Nothing : OleVariant;
begin
TVarData(Nothing).VType := varError;
TVarData(Nothing).VError := DISP_E_PARAMNOTFOUND
> TVarData(Nothing).VType := varError;
> TVarData(Nothing).VError := DISP_E_PARAMNOTFOUND
How did you find this?
var Nothing:OleVariant;
....
TVarData(Nothing).VType:=varError;
TVarData(Nothing).VError:=DISP_E_PARAMNOTFOUND;
Scott Samet [TeamB] wrote in message ...
jmerril...@mnsinc.com wrote in message
<09980012125246.OUI...@mnsinc.com>...
It is odd to me that VBA likes a "param not found error variant" for
optional parameters (vs Unassigned or Null), but little that MS is doing
here makes a lot of sense to me...
J. Merrill wrote in message <09980022172852.OUI...@mnsinc.com>...
It's just bizarre that an optional parameter is a type of error! But
once you know the mystical incantation for making that Nothing variant,
it all becomes easy.
--
- J. Merrill jmerril...@mnsinc.com