akr Posted July 13, 2019 Share Posted July 13, 2019 Hi, I am trying to write a unigui custom component. For testing I derived a simple component from TUniEdit. It compiles and gets installed. As soon as I put it on a unigui form I get a access violation in rtl250.bpl in function "GetPropList". Doing the same in Delphi Pascal works fine. Has this ever worked? Any change to get it fixed? We are evaluating unigui for a large C++ application. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 16, 2019 Administrators Share Posted July 16, 2019 Hi, Make sure you statically link all libs with your exe. Link to comment Share on other sites More sharing options...
akr Posted July 16, 2019 Author Share Posted July 16, 2019 Hi, I have a package (bpl), no exe. Exe seems to work. I need to convert existing c++ components from vcl to unigui first. How to statically link a bpl? Can u provide a example please? Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 16, 2019 Administrators Share Posted July 16, 2019 I am referring to Quote Additional steps for C++ Builder •After starting a new C++ project, you must disable Linker->Dynamic RTL. •New C++ projects are created without a resource (.RES) file. As a result, the project has no default Icon. This issue will be fixed in next releases. •Combo VCL/ISAPI projects are not supported for C++ Builder. •It is recommended to build your C++ Builder app without Run-Time Packages. You must statically link all libraries and create a single EXE. You can also use the default mode which uses run-time packages by default. If you want to build your application in this mode, then please read section Run-time Packages & C++ Builder. Please see below docs: http://www.unigui.com/doc/online_help/installation_instructions.htm http://www.unigui.com/doc/online_help/runtime-packages--c-builder.htm Link to comment Share on other sites More sharing options...
akr Posted July 16, 2019 Author Share Posted July 16, 2019 Thank you. But still not working. My test exe is linked statically - > working My bpl can only be linked dynamically -> not working. Still crashing at the same function stated above. Some missing RTTI afaik. This is my current linker commandline (important part): C:\Users\Public\Documents\Embarcadero\Studio\19.0\DCP -lC:\Users\Public\Documents\Embarcadero\Studio\19.0\DCP -r -v -Gi -Gn -aa -s -V5.0 -GBCustomComp -Tpp c0pkg32 dbrtl.bpi rtl.bpi uIndy25.bpi uniGUI25.bpi uniGUI25Chart.bpi uniGUI25Core.bpi uniTools25.bpi vcl.bpi vcldb.bpi memmgr.lib sysinit.obj .\Win32\Debug\CustomComp.obj .\Win32\Debug\UniDateTimePicker1.obj , C:\Users\Public\Documents\Embarcadero\Studio\19.0\BPL\CustomComp.bpl , C:\Users\Public\Documents\Embarcadero\Studio\19.0\BPL\CustomComp.map , import32.lib cp32mt.lib , , CustomComp.res Can u please make: 1) A Package project in C++ 2) Add a component, derived from e.g. TUniEdit. 3) Compile, install and drag it on a form. Is it crashing? Please advise. Link to comment Share on other sites More sharing options...
akr Posted July 20, 2019 Author Share Posted July 20, 2019 Looks like C++ does not work with unigui. Giving up now. This is too bad because the new C++ compilers are clang based and produce a highly optimized code. Much better than all existing delphi compilers. I cant understand this. While Pascal is a good programming language C++ opens the doors to other projects in the world. This community should be more open minded to programming languages which are state of the art nowadays. Link to comment Share on other sites More sharing options...
akr Posted July 24, 2019 Author Share Posted July 24, 2019 It looks like the problem can be reproduced with static linked executables. The following crashes with unigui while it works with vcl without problems. I debugged pulling the source module from vcl into my project. Its crashing in GetPropList due to problems in the RTTI info. Please advise!!! __fastcall TMainForm::TMainForm(TComponent* Owner) : TUniForm(Owner) { int count; TPropList list; count=GetPropList(PTypeInfo(__delphirtti(TMainForm)),tkAny ,&list, true); ShowMessage(IntToStr(count)); } Link to comment Share on other sites More sharing options...
akr Posted July 28, 2019 Author Share Posted July 28, 2019 Solved. That was a nightmare. But now I am happy to have a solution. @Farshad Mohajeri Not sure if my fix is good. But I am happy to discuss. Link to comment Share on other sites More sharing options...
akr Posted July 30, 2019 Author Share Posted July 30, 2019 @SherzodCan we discuss please. We cannot buy before we get our questions answered. Thanks. Link to comment Share on other sites More sharing options...
akr Posted August 7, 2019 Author Share Posted August 7, 2019 Here is a problem descripton and workaround: The problem occurs when a new package & component is built. Lets say a component TUIEdit is inherited from TUniEdit. TUniEdit has about 49 properties. The c++ the compiler runs and produces a new object file. In the object file you can see (I am using tdump) that 51 properties generated even if TUIEdit has no additional properties! So TUIEdit crashes when installed in the IDE as described above. I am happy to provide a testcase to have this fixed in future versions. Fix/Workround: Just uncomment properties. In the example above uncomment 2 properties to get a correct number of 49 properties in the c++ header in the common directory. Link to comment Share on other sites More sharing options...
RobertoLopes Posted August 8, 2019 Share Posted August 8, 2019 11 hours ago, akr said: Here is a problem descripton and workaround: The problem occurs when a new package & component is built. Lets say a component TUIEdit is inherited from TUniEdit. TUniEdit has about 49 properties. The c++ the compiler runs and produces a new object file. In the object file you can see (I am using tdump) that 51 properties generated even if TUIEdit has no additional properties! So TUIEdit crashes when installed in the IDE as described above. I am happy to provide a testcase to have this fixed in future versions. Fix/Workround: Just uncomment properties. In the example above uncomment 2 properties to get a correct number of 49 properties in the c++ header in the common directory. We run all of our over 5.000.000 lines of code in Unigui in C++ builder ONLY. Works likea charm. I do not understand. What's the problem? Link to comment Share on other sites More sharing options...
akr Posted August 8, 2019 Author Share Posted August 8, 2019 It works great as long as you produce an executable. Have you ever tried to create a component inherited from an unigui component? (Bpl) Link to comment Share on other sites More sharing options...
RobertoLopes Posted August 8, 2019 Share Posted August 8, 2019 Yes, I do have over 10 self developed components. No problem with that too. Link to comment Share on other sites More sharing options...
akr Posted August 9, 2019 Author Share Posted August 9, 2019 It depends. As soon as components are inherited from unigui components like TUniEdit or similiar it crashes as described above. Simple as that. Easy to reproduce: 1) Create a new Package project in C++ 2) Add a component, derived from e.g. TUniEdit. 3) Compile, install and drag it on a form. It crashes! We have a C++ application with 150 windows, 10m lines of code and 35 GUI components inherited from vcl. We need to get this fixed and are waiting for UniListView. Link to comment Share on other sites More sharing options...
Abaksoft Posted August 9, 2019 Share Posted August 9, 2019 @akr I have not C++ builder. But on an Unigui delphi Project there is a menu to create 'inherited items" from your existing project forms or frames. You can create an UniguiFrame class which contains an UniEdit component and do what you want... Link to comment Share on other sites More sharing options...
akr Posted August 9, 2019 Author Share Posted August 9, 2019 @Abaksoft This works for forms only. I want to create a new designtime component inherited from other components. Still crashing. Unchanged: class PACKAGE TUIEdit : public TUniEdit { private: protected: public: __fastcall TUIEdit(TComponent* Owner); __published: }; Link to comment Share on other sites More sharing options...
akr Posted August 17, 2019 Author Share Posted August 17, 2019 Any ideas here? Why is the number of properties of a unigui inherited component in C++ wrong? Link to comment Share on other sites More sharing options...
Abaksoft Posted September 26, 2019 Share Posted September 26, 2019 Link to comment Share on other sites More sharing options...
akr Posted September 26, 2019 Author Share Posted September 26, 2019 Hi, this doesnt solve my problem. This is about C++ and components inherited from unigui classes. Wrong topic! Link to comment Share on other sites More sharing options...
akr Posted November 28, 2019 Author Share Posted November 28, 2019 On 7/13/2019 at 11:15 PM, akr said: Hi, I am trying to write a unigui custom component. For testing I derived a simple component from TUniEdit. It compiles and gets installed. As soon as I put it on a unigui form I get a access violation in rtl250.bpl in function "GetPropList". Doing the same in Delphi Pascal works fine. Has this ever worked? Any change to get it fixed? We are evaluating unigui for a large C++ application. Sherzod, Farshad, just wanna know if there are any news with C++. Same behaviour in 10.3.3. Still crashing when building components with C++. Everything is described here. Either a unigui or cbuilder bug. Hard to say. cbuilder comsumes headers generated by delphi on install time. Compiles well. But when component is installed in ide it crashes immediately. When I remove a property (e.g. RTL, commented out in uniguiclasses.hpp), some components start working. Strange. (1509 Demo) Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now