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 

A Strange question with TSiLang5.2.5

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



Joined: 17 Aug 2004
Posts: 3

PostPosted: Tue Aug 17, 2004 4:05 pm    Post subject: A Strange question with TSiLang5.2.5 Reply with quote

I'm useing TSiLang5.2.5 with Delphi6.

My Project is work well,it has tens of forms and units with TSilang.All the tsilang is linked to siLangDispatcher on the DataModule.The End User can edit the .SIB file easily and can be loaded as run time.


But suddenly,a strange question happen,the Project can not load sib file at run-time:(

It has an exception :Access violation at address **** in module **.exe...

When I use Breakpoint,I find the question is at:

procedure TSIBFileManager.LoadFromStream(const AComp: TsiCustomLang; const
AOwnerClassName: string; AStream: TStream);

....

siClass := TComponentClass(GetClass(AComp.Classname));
SI := TsiCustomLang(siClass.Create(frm));//error here...
....

I find the siClass is nil ,so ...

Is this a question with tsilang? or my code error?
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Tue Aug 17, 2004 5:18 pm    Post subject: Reply with quote

This is strange and looks like in your application there somewhere made some class registration/unregistration routines. You can try detect by yourself the problem place or you may try to recreate step-by-step the project structure and check after what stage the error appears.
Hope this helps.
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Tue Aug 17, 2004 5:20 pm    Post subject: Reply with quote

Also: the updating to most recent version (available now Exclamation) is recommended Wink
Back to top
View user's profile Send private message
weide



Joined: 17 Aug 2004
Posts: 3

PostPosted: Wed Aug 18, 2004 1:38 am    Post subject: Reply with quote

I have downloaded the 5.3.1,but not resove the question:(

What does "made some class registration/unregistration routines" mean?Could you give me some example?

Now,I am recreating step-by-step the project structure ...
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Wed Aug 18, 2004 4:42 am    Post subject: Reply with quote

weide wrote:
What does "made some class registration/unregistration routines" mean?Could you give me some example?

When GetClass() returns nil this means that by some reason Delphi doesn't "know" the requested class.

Can you check what value returns the AComp.Classname ?
Wait! I have one idea:
May be you've created your SIB file from SIL? In such case please add siLngLnk to uses clause of your application units. Anyway, please check what AComp.Classname returns and be sure that your project knows about such class, in case not just add the respective unit from TsiLang folder to your uses clause.

Please let us know if this helps.
Back to top
View user's profile Send private message
weide



Joined: 17 Aug 2004
Posts: 3

PostPosted: Wed Aug 18, 2004 2:49 pm    Post subject: Reply with quote

To isiticov:
I think I have resolved the question.

1.AComp.Classname is TSilang,but getClass is nil
2.siLngLnk is no use...but when I use TSilangDispatcher in a dll,it is nessessary...I will say more later...
3.The answer to My question:For some reason,I used showmessage,and in my uses clause,I used 'QDialogs'---Just this reason.Replace with Dialogs.Every thing is OK! You can test it.But I think no other else use QDialogs maybe.


4.When used in DLL I define a Form in DLL,and I want to support mulilanguages too.But It seems no use.The Code I write like this:

Function fShowRoutineChartForTradex(AHandle:THandle;zltx:string;ChartType:integer; SmpSize:integer; RawData:array of double;usl,sl,lsl:double;bGiven:boolean;bUcl,bCL,bLcl:double;AComp:TComponent=nil):wordbool;
begin
result:=true;
application.Handle:=AHandle;
With TfrmGraph.Create(application) do
try
if AComp is TsiLangDispatcher then begin
siLang1.LangDispatcher:=TsiLangDispatcher(AComp);
TsiLangDispatcher(AComp).LoadAllFromFile(TsiLangDispatcher(AComp).FileName);
end;
ShowModal
finally
Free;
end;
end;

The same code I use by source--I mean add the DLL source to my project ,It work well...

Is TSilang support DLL form and load from SIB file?
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Wed Aug 18, 2004 4:08 pm    Post subject: Reply with quote

Quote:
if AComp is TsiLangDispatcher then begin

This will not work in DLL, because DLL and main executable has different RTTI spaces and such operands as
Code:
IS, AS
won't work when passing/evaluating types and classes. You shall either use run-time packages or just pass ActiveLanguage and FileName to your init procedure of DLL and then use internal dispatcher for all tasks.
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