mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-10 22:09:18 +02:00
no message
This commit is contained in:
parent
d4117aeb34
commit
37a2ed983f
@ -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
34
tests/webtbs/tw3216.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user