Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Language/Variants    [ Add a report in this area ]  
Report #:  104954   Status: Closed
word_tlb.pas does not compile
Project:  Delphi Build #:  16.0.4429.46931
Version:    16.4 Submitted By:   Colin Kemp
Report Type:  Basic functionality failure Date Reported:  4/16/2012 11:28:40 PM
Severity:    Serious / Highly visible problem Last Updated: 12/11/2012 10:30:44 PM
Platform:    All versions Internal Tracking #:   30792
Resolution: Fixed (Resolution Comments) Resolved in Build: : 17.0.4723.55752
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
I have createed word_tlb.pas and correctly stored the file in a folder on my library path.
When compiling word_tlb.pas fails to compile and produces two errors
[DCC Error] Word_TLB.pas(39991): E2014 Statement expected, but expression of type 'OleVariant' found
[DCC Fatal Error] Word_TLB.pas(40000): E2226 Compilation terminated; too many errors
both point to the definition of
'EmptyParam'
Steps to Reproduce:
rebuild word_tlb.pas from Component => Install Component => Import a Type Library. Add to a project and compile

Added by Sysop
<<<<<<<
See this post for more information.
https://forums.embarcadero.com/thread.jspa?messageID=479357&#479357

I use Win 7 64 Bit, Office 2010 64 Bit and Delphi 16.0.4429.46931

I go to component, import component, generate component wrappers for Word 2010 TLB.

The resulting word_tlb could not compile:

procedure TWordApplication.Quit;
var
EmptyParam: OleVariant;
begin
EmptyParam := System.Variants.EmptyParam;

[DCC Error] Word_TLB.pas(39619): E2018 Record, object or class type required
[DCC Error] Word_TLB.pas(39619): E2014 Statement expected, but expression of type 'OleVariant' found

This errors occurs housend of times and the compiler aborts with

[DCC Fatal Error] Word_TLB.pas(40000): E2226 Compilation terminated; too many errors

The problem is that the word_tlb contains an object system. System. then reference this object and this has no Variants.EmptyParam.

The uses-clause in the word_tlb looks like

uses Winapi.Windows, Office_TLB, System.Classes, System.Variants, System.Win.StdVCL, VBIDE_TLB, Vcl.Graphics, Vcl.OleServer,
Winapi.ActiveX;

If System.Variants is changed to Variants and

procedure TWordApplication.Quit;
var
EmptyParam: OleVariant;
begin
EmptyParam := Variants.EmptyParam;

then all works fine.

But it can't be the solution to edit all typelibs after creation.
>>>>>>>>
Workarounds
No work around found at time of submission
Attachment
None
Comments

Tomohiro Takahashi at 4/17/2012 8:01:34 AM -
> Build No: 7601
What version and build no of Delphi do you use, for example Delphi XE2 Update 4(16.0.4429.46931)?

> I have createed word_tlb.pas ...
Could you tell us how you created the .pas?

and, could you attach sample package project to reproduce your issue?

Stefan Westner at 8/8/2012 2:05:42 AM -
See my posting at:
https://forums.embarcadero.com/thread.jspa?messageID=479357&#479357


Hello,

I have a problem which someone else already posted on QC (104954).

I use Win 7 64 Bit, Office 2010 64 Bit and Delphi 16.0.4429.46931

I go to component, import component, generate component wrappers for Word 2010 TLB.

The resulting word_tlb could not compile:

procedure TWordApplication.Quit;
var
EmptyParam: OleVariant;
begin
EmptyParam := System.Variants.EmptyParam;

[DCC Error] Word_TLB.pas(39619): E2018 Record, object or class type required
[DCC Error] Word_TLB.pas(39619): E2014 Statement expected, but expression of type 'OleVariant' found

This errors occurs housend of times and the compiler aborts with

[DCC Fatal Error] Word_TLB.pas(40000): E2226 Compilation terminated; too many errors

The problem is that the word_tlb contains an object system. System. then reference this object and this has no Variants.EmptyParam.

The uses-clause in the word_tlb looks like

uses Winapi.Windows, Office_TLB, System.Classes, System.Variants, System.Win.StdVCL, VBIDE_TLB, Vcl.Graphics, Vcl.OleServer,
Winapi.ActiveX;

If System.Variants is changed to Variants and

procedure TWordApplication.Quit;
var
EmptyParam: OleVariant;
begin
EmptyParam := Variants.EmptyParam;

then all works fine.

But it can't be the solution to edit all typelibs after creation.

How could this problem solved?

Greetings

Stefan

Tomohiro Takahashi at 8/8/2012 6:05:11 PM -
This report was opened with valid Internal Tracking Number.
Thanks.

Server Response from: ETNACODE01