Valentina 3 COM and Delphi

Ivan Smahin IvanSmahin at public.kherson.ua
Fri Jul 6 03:29:29 CDT 2007


Hello Martin,

Friday, July 6, 2007, 10:57:57 AM, you wrote:

MS> Ivan Smahin schrieb:
>>      V3 := CoValentina.Create;
>>      V3.InitClient(10 * 1024 * 1024);
>>      
>>      V3Conn := CoVConnection.Create;
>>      V3Conn.Init('localhost','sa','sa',15432,20,'');
>>      V3Conn.Open;
>>
>>      
>>   

MS> Unfortunately, it does not work ;(
MS> In Delphi I've choosen "New => VCL Application", then "New => COM 
MS> Object", named the new Object "Valentina" and selected "IValentina" in
MS> VCOM.dll as interface.
MS> Then, Delphi generates some wrapper-code. When I try to start my program
MS> (without any additional code), I get an exception "For class TValentina
MS> type information is missed".
MS> When I comment out the TValentina class (which is not needed in my eyes
MS> because everything goes over the interfaces an CO-Classes CoValentina,
MS> CoVconnection etc.),
MS> I get an exception "Class not registered" and the debugger points to 
MS> this code, which is automatically generated from the VCOM interface:

MS> class function CoValentina.Create: IValentina;
MS> begin
MS>   RegisterClass(CLASS_Valentina) ;
=>>  Result := CreateComObject(CLASS_Valentina) as IValentina;
MS> end;

MS> I use BDS 2006 with all service packs installed.

I  can  send you some little example. Works in Delphi 4. I don't think
it  would  be  some  much  differences  in later versions regarding COM
usage.

About 7 years ago was last time I used Delphi. So sorry I can be wrong
on   some  points.  But  as  far  as I recall you can easily build tlb
files.  Try  following  -  Project  -  Import  type  library  - choose
Valentina COM there - press Ok.

Then, in Project

uses
...
  ValentinaCOM2_TLB in 'd:\Program Files\Borland\Delphi4\Imports\ValentinaCOM2_TLB.pas';
...

...
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ValentinaCOM2_TLB;

...



-- 
Best regards,
Ivan Smahin 
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com



More information about the Valentina mailing list