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 

Access violation when calling EditProperty EditAll of LangRT

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



Joined: 24 Apr 2003
Posts: 8

PostPosted: Thu Apr 24, 2003 8:13 am    Post subject: Access violation when calling EditProperty EditAll of LangRT Reply with quote

Using 5.2.2 CLX D7
I am getting Access violation when I try to call
LangRT.EditProperty or EditAll

the exception raises in QsiTransEditor
TsiTransEditFrm.GetProperties

Tested the same code on Kylix 3, everything is fine.

Anyone aware of this problem?

Emin
Back to top
View user's profile Send private message
gaivans



Joined: 29 Nov 2002
Posts: 71

PostPosted: Thu Apr 24, 2003 10:21 am    Post subject: Reply with quote

Hello,

Which third-party components do you use in your project?

For the quick solution of the problem I suggest the following:

1. Open the TsiLang_D7_CLX.dpk package and open its file
"QsiTransEditor.pas"
2. Locate in the unit the method:
procedure TsiTransEditFrm.GetProperties(const AComp: TsiCustomLang);
3. After the line:
...
RootNode := TreeView.Items.AddObject(nil, 'Translations', nil);
...
remove or comment the line:
...
if sfDesignTime in Flags then
...
4. Save the unit and re-build the package.

After that the Translation Editor should work in the run-time
Back to top
View user's profile Send private message AIM Address MSN Messenger
emin



Joined: 24 Apr 2003
Posts: 8

PostPosted: Thu Apr 24, 2003 10:43 am    Post subject: Reply with quote

>> Which third-party components do you use in your project?

Only FastReport and TsiLang.

Will this solution be included in coming releases or shall I apply
this source change in new release?

Thank you,
Emin
Back to top
View user's profile Send private message
emin



Joined: 24 Apr 2003
Posts: 8

PostPosted: Thu Apr 24, 2003 11:11 am    Post subject: Reply with quote

applied the fix and delete/rebuild the package, but it did not help.
Still getting the access violation in TsiTransEditFrm.GetProperties
at line:
FComp := TsiCustomLang(TComponentClass(GetClass AComp.ClassName)).Create(nil));

Thank you
Emin
Back to top
View user's profile Send private message
gaivans



Joined: 29 Nov 2002
Posts: 71

PostPosted: Thu Apr 24, 2003 12:05 pm    Post subject: Reply with quote

Hello,

I have downloaded FastReport 3 CLX beta and it seems compatible with TsiLangRT. At least when I add a TsiLangRT to their demo project it works properly either with the above changes or without.

Which version of FastReport do you use? Is that possible to reproduce the problem in a small test project? If so, could you please send it to us at
gaivans@sicomponents.com
Back to top
View user's profile Send private message AIM Address MSN Messenger
emin



Joined: 24 Apr 2003
Posts: 8

PostPosted: Thu Apr 24, 2003 1:50 pm    Post subject: Reply with quote

I have a test project to reproduce this.
but you will be able to reproduce in the following case.

Just derive a new component from TsiLangRT
and use this derived component in your project.

Even the derived component does not add/change any behavior,
I start getting access violation.

Thanks in advance,
Emin

sending test project via email.
Back to top
View user's profile Send private message
gaivans



Joined: 29 Nov 2002
Posts: 71

PostPosted: Thu Apr 24, 2003 2:09 pm    Post subject: Reply with quote

Hello,

Do you create a component derived from TsiLangRT? Then, "GetClass" returns nothing and it causes an AV at the line:
FComp := TsiCustomLang(TComponentClass(GetClass(AComp.ClassName)).Create(nil));

Look at the initialization sections of the "siLangRT.pas" or "siComp.pas". Due to several reasons we register our classes. So, if you derive a class from TsiLangRT or from other TsiCustomLang you need to register it at the initialization section of corresponding unit. For example,
...

initialization

if GetClass('TMyDerivedsiLang') = nil then RegisterClass(TMyDerivedsiLang);
...
Back to top
View user's profile Send private message AIM Address MSN Messenger
emin



Joined: 24 Apr 2003
Posts: 8

PostPosted: Thu Apr 24, 2003 2:22 pm    Post subject: Reply with quote

>>> initialization
>>> if GetClass('TMyDerivedsiLang') = nil then RegisterClass
>>> (TMyDerivedsiLang);

ok this was missing in my derived class.
After adding RegisterClass I can safely call editAll and other edit methods.

Usually I never RegisterClass unless I build projects in run time
package (BPL) mode.

Thank you very much for your fast support.

Emin Borbor,
Kimyatas
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