'Access violation' has occurred always when closing the app.

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
Ilgyu
Posts: 7
Joined: Wed Feb 19, 2020 4:43 am

'Access violation' has occurred always when closing the app.

Post by Ilgyu »

Hi.
In the C++Builder with TsiLang, 'Access violation' error has occurred always when closing a MainForm.

Environment:
Windows 10 pro
RAD Studio 10.2.3 (and 10.3.3)
TsiLang 7.8.1 (latest)

Steps to reproduce :
1. Run 'RAD Studio' and click 'Create a new Multi-Device Application - C++' and select 'Blank Application'.
2. Put the 'TsiLang' component into the TForm.
3. Compile and run.
4. Close application.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Re: 'Access violation' has occurred always when closing the app.

Post by isiticov »

Hello,

Thank you for your message. In 90% cases this is caused by linking VCL version of TsiLang units to FMX application. Please be sure that your project's path adjusted properly in order to use ONLY FMX versions of TsiLang units for FMX applications.
Ilgyu
Posts: 7
Joined: Wed Feb 19, 2020 4:43 am

Re: 'Access violation' has occurred always when closing the app.

Post by Ilgyu »

Thank you for your reply.
I have tried to exclude linking VCL version of TsiLang according to your comment, but I don't know how can I did it.
Here are what I tried,
1. Replaced "\Units\ERS XE102\$(Platform)" to "\Units\ERS XE102\$(Platform)\FMX" from the link path in the "Tools->Opions". -> Failed
2. Go to "\Units\ERS XE102\Win32" and deleted all files here. Copied all files from "\Units\ERS XE102\Win32\FMX" to here. -> Failed

Should I recompile "TsiLang_XE102.dproj"? It's OK if I remove all VCL units because most using only FMX.
Please help me how can I solve it.
Thank you.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Re: 'Access violation' has occurred always when closing the app.

Post by isiticov »

Hello,
Ah, just forgot to mention! Also please ensure that your C++Builder project doesn't use TsiLang's run-time package. Because TsiLang's run-time package is built for VCL. If this doesn't help as well then please see below:
Do you have "Full Source" license or "Binary Only"? If you have "Full Source" you can easily add TsiLang's source .PAS files to your project and just re-build it. Just add siComp.pas, MemIni.pas, siConsts.pas and siLngLnk.pas to the project, add FMX define to project options and re-build. This shall work.
In case you have "Binary Only" license then try to add FMX compiled versions of TsiLang units to you project (you can manually add .OBJ files to C++ project using Project |Add command) and build.

Please let me know if any of these helped.
Ilgyu
Posts: 7
Joined: Wed Feb 19, 2020 4:43 am

Re: 'Access violation' has occurred always when closing the app.

Post by Ilgyu »

Thank you for your kind reply.
I've not tried your suggestion yet, but I'd like to ask if I can make a run-time package that only contains FMX.
My project consists of over 200 separated bpl projects. MainFrom load these BPLs at run-time. Therefore I'm unwilling to add .pas or .obj to all project files.
I appreciated it if you inform the way how to create run-time package which only containing FMX units.

(FYI, I have 'Full source code' license)
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Re: 'Access violation' has occurred always when closing the app.

Post by isiticov »

Just follow these steps:
1. Create new package in the IDE with name like TsiLang_[YOUR_IDE]_FMXr.
2. Configure its target framework to FireMonkey (IDE will ask you when you first time compile it).
3. Add TsiLang units to this package: siComp.pas, MemIni.pas, siConsts.pas and siLngLnk.pas.
4. Add FMX define to project options.
5. Configure output paths settings.
6. Build it.
7. In your projects' options that use run-time packages replace TsiLang_[YOUR_IDE]r with created TsiLang_[YOUR_IDE]_FMXr.
Hope this helps.

Or as I said earlier, you can just remove TsiLang_[YOUR_IDE]r from run-time packages of your project and re-build it using path to FMX versions of TsiLang units. This should work and you won't need to add TsiLang units to your project(s).
Ilgyu
Posts: 7
Joined: Wed Feb 19, 2020 4:43 am

Re: 'Access violation' has occurred always when closing the app.

Post by Ilgyu »

I have removed TsiLang_XE102r from the "runtime package" in the project option, but the linker(ilink32) always linked 'TsiLang_XE102r.lib'. (Even though all the 'TsiLang_XE102' is deleted by opening the Project file in TextEditor, tlilnk32 always link this Lib.)
I also tried uncheck 'Link with runtime packages', but 'unresolved external' error has occurred.

Now I created a new package that including only FMX files. This works well with no error. But I cannot use LangExpert anymore. This is very inconvenient. Is there a way to install IDE tools?
And I wonder if you have a plan to create a package that working well in the FMX environment.
Thank you.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Re: 'Access violation' has occurred always when closing the app.

Post by isiticov »

Why you can't use TsiLang Expert anymore? Just don't delete TsiLang_XE102r.* files from your drive and be sure to have TsiLang_XE102.bpl installed into IDE. Then you should be able to use Expert in the IDE.

As use of run-time packages under FMX is applicable "mostly" only under Win32 and Win64 platforms very low amount of users use run-time packages for FMX applications. And the FMX version of BPL could be created easily (as I demonstrated). Also IDE itself is ONLY VCL and it "requires" VCL versions of package files.
Post Reply