<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Any body had same problem with me ?<br></span></div><div> </div><div>=============INTOSOFT============<br> ALEXIO CHAOS<br> Darmawan_Sugiarto@yahoo.com <br> Yahoo Messager<br>=================================<br></div> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Darmawan Sugiarto <darmawan_sugiarto@yahoo.com><br> <b><span style="font-weight: bold;">To:</span></b> Lazarus mailing list <lazarus@lists.lazarus.freepascal.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, January 24, 2013 12:57 PM<br> <b><span
style="font-weight: bold;">Subject:</span></b> [Lazarus] Bug on library project while accessing string<br> </font> </div> <br>
<div id="yiv739800820"><div><div style="color:#000;background-color:#fff;font-family:times new roman, new york, times, serif;font-size:12pt;"><div><span>hello guys, I got some bug on library project. When I uses Lazarus 0.9.28.2 I write this code and work well, then I recompile it use Lazarus 1.0.2 and 1.0.4 and got this error....</span></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><span><br></span></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><span>Project project_test raised exception class 'External: SIGEGV'.</span></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><span>At address 7C91B1FA<br></span></div><div style="color:rgb(0, 0,
0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br><span> </span></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><span>I have 2 project <br></span></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><span class="yiv739800820tab"> </span><span>first project is library project...</span></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><span class="yiv739800820tab">Here is the code for first project <br></span></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;
font-style:normal;"><br><span class="yiv739800820tab"></span></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><span class="yiv739800820tab">function test(_str:string):string; cdecl; export;<br></span></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br><span></span></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">implementation<br><br>function test(_str:string):string; cdecl; export;<br>var<br> _i,_l,_k,_d:integer;<br> _h:string;<br> _char:Char;<br>begin<br> if _str<>'' then<br> begin<br> _l:=length(_str);<br> //SetLength(_h,_l);<br>
_h:=_str;<br>
_char:='t';<br> _h[1]:=_char;<br> end else _h:='';<br> Result :=_h;<br>end;<br><span></span></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><span><br></span></div><div> Then second project is application project.<br>I got 1 button to execute function in the library project.<br>Here is the code.<br><br> function test(_str:string):string; cdecl; external 'project1.dll' name 'TEST';<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.lfm}<br><br>{ TForm1 }<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> ShowMessage(test('alex'));<br>end; <br><br>I got that error when I click the button.<br>If I delete this selection, It work well<br> <span style="
font-weight:bold;">_h[1]:=_char;</span><br><br></div><div>=============INTOSOFT============<br> ALEXIO CHAOS<br> Darmawan_Sugiarto@yahoo.com <br> Yahoo Messager<br>=================================<br></div> <div style="font-family:times new roman, new york, times, serif;font-size:12pt;"> <div style="font-family:times new roman, new york, times, serif;font-size:12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"><b><span style="font-weight:bold;"></span></b></font><br> </div></div> </div> </div></div></div><br>--<br>_______________________________________________<br>Lazarus mailing list<br><a ymailto="mailto:Lazarus@lists.lazarus.freepascal.org" href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br><a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br><br><br> </div> </div>
</div></body></html>