SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with const section

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
Anske



Joined: 17 Sep 2003
Posts: 6

PostPosted: Wed Sep 17, 2003 10:56 am    Post subject: Problem with const section Reply with quote

I'm currently evaluating TsiLang Components and have some problems with translating the const section. After translating the strings I'm trying to run my program, but is fails to start giving me a Stack Overflow message.

Any help would be apreciated.

Regards
Anske
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Wed Sep 17, 2003 11:46 am    Post subject: Reply with quote

It looks like in your code there is circular calling of some procedure. Please try to reproduce the problem on simple sample test project and check if error gone. And then just compare sources of your unit with sample test units to check the differences.
Back to top
View user's profile Send private message
Anske



Joined: 17 Sep 2003
Posts: 6

PostPosted: Wed Sep 17, 2003 12:46 pm    Post subject: Reply with quote

This works fine.
I'm using the components on a datamodule which is autocreated before the mainform (in both apps)
I put for testing a breakpoint on the 'Updatestrings' in both the 'oncreate' as well as in the 'changelanguage' procedures and found out that in my 'problem' app the oncreate is never called (property settings are OK) in the little demo app this works fine
Back to top
View user's profile Send private message
Anske



Joined: 17 Sep 2003
Posts: 6

PostPosted: Wed Sep 17, 2003 2:52 pm    Post subject: Reply with quote

Digging a little deeper.
Somehow the procedure ChangeLanguage is run twice before the oncreate of the datamodule. This is not happening in my little demo app.
any clou?
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Thu Sep 18, 2003 7:15 am    Post subject: Reply with quote

This looks like somewhere in your "problem" application code you're manually calling OnCreate event of datamodule. Please check this and let us know if this is the origin of problem.
Back to top
View user's profile Send private message
Anske



Joined: 17 Sep 2003
Posts: 6

PostPosted: Thu Sep 18, 2003 7:56 am    Post subject: Reply with quote

Nope.
I have at this moment 2 TsiLang components (1 on the datamodule and 1 on the main form) linked to the dispatcher. If I cut lose both links to the dispatcher all is going well.
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Thu Sep 18, 2003 12:38 pm    Post subject: Reply with quote

In such case the situation with calling twice ChangeLanguage is normal because it is calling for each TsiLang. Then I suppose the problem with Stack Overflow is somewhere in your code.
Back to top
View user's profile Send private message
terryk



Joined: 18 May 2005
Posts: 8

PostPosted: Wed Oct 05, 2005 7:18 am    Post subject: Same Error in current TSILang 6.0.4 Reply with quote

Hi!
In my (big) project I have the same problem with Stack-Overflow.
Now I found the error. It is a problem of TSILang-Expert that can be reproduced. My project has some inherited frames and when Expert modifies code of const section, it adds (by mistake?) the line "UpdateStrings" in the same procedure UpdateStrings which causes this infinte loop. Here's what the Expert does:

// Complete proc added by Expert
procedure TMyFrame.siLang1ChangeLanguage(Sender: TObject);
begin
UpdateStrings;
inherited;
end;

// Complete proc added by Expert
procedure TMyFrame.UpdateStrings;
begin
sAlarm_1000 := siLang.GetTextOrDefault('strsAlarm_1000');
sTooHigh := siLang.GetTextOrDefault('strsTooHigh');
sTooLow := siLang.GetTextOrDefault('strsTooLow');
sOK := siLang.GetTextOrDefault('strsOK');
UpdateStrings; // ERROR!!!!
inherited;
end;

Well I also found out, that Expert will not always produce this error. My project has about 50 Frames an the error occured only in about 35-40 Frames.
Any suggestion about this?

Regards
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Wed Oct 05, 2005 8:23 am    Post subject: Reply with quote

We will try to improve this, but currently the workaround would be only manually check the source generated by expert and fix if it is inappropriate. Sad
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group