Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-10

Can you reproduce the following Access Violation ?

7 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ik

Hello,

When I write something like so:

-----------------------------------------------------
type
  TForm1 = class(TForm);
  TSomeClass = class
  ...
  end;
  TForm1 = class(TForm)
  ...
  end;

------------------------------------------------------

If I try to rename a component in design time (Other then the form itself), it will throw at me Access Violation.

I'm using: Lazarus 1.1 r39114M FPC 2.6.0 x86_64-linux-gtk 2

Can you reproduce the following issue (So I could report a bug), or am I missing something here ?

Thanks,
Ido

Reply by email

Corpsman
to ik
if i write
Type
   TForm1 = Class(TForm);
   TSomeClass = Class
   private
   public
   End;
   TForm1 = Class(TForm)
   private
     { private declarations }
   public
     { public declarations }
   End;

set a Tbutton on the TForm1 and double click ( to create the OnClick Event )

I get also the exception :

The component editor of class "TDefaultComponentEditor" has created the error:
"Unable to create new method. Please fix the error shown in the message window, which is normally below the source editor."

Lazarus 1.1 r39114M Free Pascal Compiler version 2.6.0-1 [2012/01/13] for i386

Corpsman on Kubuntu 12.04

ik wrote 36 lines
Hello, When I write something like so: ----------------------------------------------------- type TForm1 = class(TForm); TSomeClass = class ... end; TForm1 = class(TForm) ... end; ------------------------------------------------------ If I try to rename a component in design time (Other then the form itself), it will throw at me Access Violation. I'm using: Lazarus 1.1 r39114M FPC 2.6.0 x86_64-linux-gtk 2 Can you reproduce the following issue (So I could report a bug), or am I missing something here ? Thanks, Ido -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Auf meiner Homepage www.Corpsman.de ist immer was los, st?ndig wird sie aktualisiert und erweitert. Da ist f?r jeden was dabei.

Reply by email

John Landmesser
to Corpsman
Corpsman wrote 16 lines
set a Tbutton on the TForm1 and double click ( to create the OnClick Event ) I get also the exception : The component editor of class "TDefaultComponentEditor" has created the error: "Unable to create new method. Please fix the error shown in the message window, which is normally below the source editor." Lazarus 1.1 r39114M Free Pascal Compiler version 2.6.0-1 [2012/01/13] for i386 Corpsman on Kubuntu 12.04

TButton on Form and double click:
No probs with
Lazarus 1.1 r39114M FPC 2.6.0 i386-linux-gtk 2

Reply by email

ik
to Corpsman: if i write Type TForm1 = Class(TForm); TSomeClass = Class private public End; TForm1 =…
Corpsman wrote 30 lines
if i write Type TForm1 = Class(TForm); TSomeClass = Class private public End; TForm1 = Class(TForm) private { private declarations } public { public declarations } End; set a Tbutton on the TForm1 and double click ( to create the OnClick Event ) I get also the exception : The component editor of class "TDefaultComponentEditor" has created the error: "Unable to create new method. Please fix the error shown in the message window, which is normally below the source editor." Lazarus 1.1 r39114M Free Pascal Compiler version 2.6.0-1 [2012/01/13] for i386 Corpsman on Kubuntu 12.04

I have reported it: http://bugs.freepascal.org/view.php?id=23148

Show quoted text 54 lines
On 10/17/2012 06:28 PM, ik wrote: > > Hello, > > When I write something like so: > > ----------------------------------------------------- > type > TForm1 = class(TForm); > > TSomeClass = class > ... > end; > > TForm1 = class(TForm) > ... > end; > > > ------------------------------------------------------ > > If I try to rename a component in design time (Other then the form > itself), it will throw at me Access Violation. > > I'm using: Lazarus 1.1 r39114M FPC 2.6.0 x86_64-linux-gtk 2 > > Can you reproduce the following issue (So I could report a bug), or am > I missing something here ? > > Thanks, > Ido > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > -- Auf meiner Homepage www.Corpsman.de ist immer was los, st?ndig wird sie aktualisiert und erweitert. Da ist f?r jeden was dabei. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

stdreamer
to ik: When I write something like so: ----------------------------------------------------- type
ik wrote 30 lines
Hello, When I write something like so: ----------------------------------------------------- type TForm1 = class(TForm); TSomeClass = class ... end; TForm1 = class(TForm) ... end; ------------------------------------------------------ If I try to rename a component in design time (Other then the form itself), it will throw at me Access Violation. I'm using: Lazarus 1.1 r39114M FPC 2.6.0 x86_64-linux-gtk 2 Can you reproduce the following issue (So I could report a bug), or am I missing something here ? Thanks, Ido

I am guessing that the 1st TForm1 declaration mend to be a forward declaration.
In that case you have defined it wrong.
Tform1 = class(Tform);
is equal to
TForm1 = class(TForm)
end;
and not a forward declaration. In your case you have 2 components defined with the same name in the same unit and probably creates conflicts. try to change the first declaration to
TForm1 = class;
and see what happens.

Reply by email

ik
to stdreamer
stdreamer wrote 44 lines
On 17/10/2012 7:28 ??, ik wrote: > > Hello, > > When I write something like so: > > ----------------------------------------------------- > type > TForm1 = class(TForm); > > TSomeClass = class > ... > end; > > TForm1 = class(TForm) > ... > end; > > > ------------------------------------------------------ > > If I try to rename a component in design time (Other then the form > itself), it will throw at me Access Violation. > > I'm using: Lazarus 1.1 r39114M FPC 2.6.0 x86_64-linux-gtk 2 > > Can you reproduce the following issue (So I could report a bug), or am > I missing something here ? > > Thanks, > Ido > I am guessing that the 1st TForm1 declaration mend to be a forward declaration. In that case you have defined it wrong. Tform1 = class(Tform); is equal to TForm1 = class(TForm) end; and not a forward declaration. In your case you have 2 components defined with the same name in the same unit and probably creates conflicts. try to change the first declaration to TForm1 = class; and see what happens.

You are right :(
And I can't reproduce it again.

Show quoted text 9 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mattias Gaertner
to ik: When I write something like so: ----------------------------------------------------- type

ik hat am 17. Oktober 2012 um 18:28 geschrieben:

Show quoted text 7 lines
Hello, When I write something like so: ----------------------------------------------------- type TForm1 = class(TForm);

This is *not* a forward defined class, this is a normal class. And therefore you have two definitions of TForm1. This s valid Object Pascal, but the IDE always uses the first.

Show quoted text 14 lines
TSomeClass = class ... end; TForm1 = class(TForm) ... end; ------------------------------------------------------ If I try to rename a component in design time (Other then the form itself), it will throw at me Access Violation.

I fixed the AV. But the missing "end" is not yet auto added. But maybe this is a good thing, so users see that something went wrong.

I'm using: Lazarus 1.1 r39114M FPC 2.6.0 x86_64-linux-gtk 2 Can you reproduce the following issue (So I could report a bug), or am I missing something here ?

Mattias

Reply by email