no message

This commit is contained in:
florian 2004-08-07 17:00:33 +00:00
parent d4117aeb34
commit 37a2ed983f
2 changed files with 34 additions and 57 deletions

View File

@ -1,57 +0,0 @@
{ Source provided for Free Pascal Bug Report 3214 }
{ Submitted by "Mattias Gaertner" on 2004-07-17 }
{ e-mail: mattias@freepascal.org }
program InvalidOpcode;
{$mode objfpc}
{$H+}
{$R+}
uses
Classes, SysUtils;
type
TMyEvent = class(TObject)
public
procedure SaveToStream(aStream: TStream); virtual; abstract;
end;
TMyClass = class
private
function GetEvent(aIndex: integer): TMyEvent;
function GetEventCount: integer;
public
property EventCount: integer read GetEventCount;
property Events[aIndex: integer]: TMyEvent read GetEvent;
procedure SaveToStream(aDest: TStream);
end;
{ TMyClass }
function TMyClass.GetEvent(aIndex: integer): TMyEvent;
begin
Result:=nil;
end;
function TMyClass.GetEventCount: integer;
begin
Result:=0;
end;
procedure TMyClass.SaveToStream(aDest: TStream);
var
cEvent: Integer;
eCnt: Integer;
begin
eCnt:=EventCount;
aDest.Write(eCnt, sizeof(eCnt));
for cEvent := 0 to eCnt -1 do
Events[cEvent].SaveToStream(aDest);
end;
var
M: TMyClass;
begin
M:=TMyClass.Create;
M.SaveToStream(nil);
end.

34
tests/webtbs/tw3216.pp Normal file
View File

@ -0,0 +1,34 @@
{ Source provided for Free Pascal Bug Report 3216 }
{ Submitted by "Mark Honman" on 2004-07-17 }
{ e-mail: wania_mark@yahoo.co.uk }
program OLEVariantPropertyBug;
{$mode objfpc}{$H+}
uses
Classes;
type TShowProblem = class
function GetValue(Index : integer) : OleVariant; stdcall;
property IWontCompile[Index : integer] : OleVariant read GetValue;
end;
{ Note :
if any of the following is changed, the problem disappears
* make it a scalar (non-indexed) property
* remove the stdcall directive
* change the type of the property to something else
although quite obscure, it would be very useful to have this fixed as it will
greatly assist in interfacing to external OLE objects - in this case the ADO
library for access to MS SQL Server.
Identified with FPC 1.9.3 on Windows ME.
}
function TShowProblem.GetValue(Index : integer) : OleVariant; stdcall;
begin
end;
begin
end.