0

There are little bit problem. I have an exception like this one "Project project1 raised exception class 'External: SIGSEGV'. In file '.\include\control.inc' at line 3251: GetTextMethod := TMethod(@Self.GetTextBuf);

Code, which trigger exception:

procedure load_translation(language: string);
var 
 iit: integer;
begin  
 Form1.Caption:='Form 1';
 Form2.Caption:='Form 2';   //as well as Unit2.Form2.Caption:='Form 2';
end;

procedure TForm1.Image1Click(Sender: TObject);
begin
  language:='en';
  load_translation(language);
end; `

I have a second Form, which already designed (not in runtime), so Exception raised when setting Text property of TEdit in custom component (Lazarus) not applicable in my case.

debug output:

<-stack-list-arguments 1 0 0> ^done,stack-args=[frame={level="0",args=[{name="this",value="<error reading variable>"},{name="result",value="0x0"}]}] (gdb) <-stack-list-locals 1> ^done,locals=[{name="LEN",value="5987780"},{name="GETTEXTMETHOD",value="{CODE = 0xc, DATA = 0x3676c0}"},{name="GETTEXT",value="0x25cf9d8"},{name="RESULT",value="0x25cf9d8"}] (gdb)

Community
  • 1
  • 1
Areso
  • 67
  • 1
  • 2
  • 11
  • is Form2 autocreated (ie do you have an instance of TForm2?) – whosrdaddy Jun 10 '15 at 13:51
  • What you are meant "autocreated"? It was added to project via File - > Add form, and then it was indicated in uses Unit2 in 'Unit2.pas' {Form2}; as well as those instuctions works fine `Form2.Show; Form1.Hide;` – Areso Jun 10 '15 at 14:30
  • New form*, I meant to say. – Areso Jun 10 '15 at 15:57
  • 1
    So use the debugger, set a breakpoint on the `Form2.Label0.Caption` line, and when the breakpoint is hit check the value of `Form2` and `Form2.Label0`. – Ken White Jun 10 '15 at 16:16
  • Added debug output at breakpoint to question's body. – Areso Jun 10 '15 at 18:53
  • 1
    1) Your question apparently has nothing to do with Delphi, or you could use the Delphi debugger to figure this out relatively easily. 2) Your question is unclear. What does *which already designed (not in runtime)* mean? I presume you've designed it in the IDE, but where is it **created** (which is what matters)? It's apparently not created when you click `Image1` and the `Image1Click` event is fired. – Ken White Jun 10 '15 at 19:22
  • 1) you are, probably, right. But a lot of problems, which occurs there, also occurs in Delphi, and vice versa. 2) It referred to another question with the very same error (link in body for his question for reference), when a man create new objects and manipulate them via code. I have added objects via IDE (for Forms: File-New form), for others, such as Labels, Images, so on I drag'n'drop from component palette Standard. – Areso Jun 11 '15 at 09:45

0 Answers0