Jump to content

Fraser

Members
  • Content Count

    22
  • Joined

  • Last visited

Community Reputation

1 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Fraser

    Project Release Icon not Showing

    I had this kind of problem. It is caused by Windows File Explorer having a cache of icons and not updating the cache. I have checked my icons in the exe with PE Explorer and tried another file manager called Explorer++ and this confirms where the problem is.
  2. After my C++ Builder 10.4.2 Community edition license expired I got another. Now some projects have lost support for Windows 32-bit and I could not add the Windows 32-bit target platform. Strangely after trying some more I can add that platform again.
  3. More than once I have said the AccessA() type of implementation works as expected and you say otherwise. Thats ridiculous. You are the only person that has said anything about rethowing. I have seen nothing. For a start an object of one type, in my case std::logic_error, would be rethrown as the same object. But the next exception I witness, for object a, has type EExternalException. I'm not aware of any difference between function-try-block and try-block other than a function-try-block is a like a try-block around a functions entire body, a shorter notation for that. Even the standard states that where it says "try block" it can apply to either. Here is the rough mock-up of my program with some corrections; #include <vcl.h> #pragma hdrstop #include "Unit1.h" #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; class A { A() noexcept try { throw std::logic_error("test"); } catch (std::exception const &ex) { std::cout << "Caught an STL exception" << std::endl; std::exit("Done"); } }; A a; // Alternative implementation that works as expected; /*A & AccessA() { static A obj; return obj; }*/ __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { }
  4. It is not my function, it's a mock-up. My function calls exit so it does not throw again and can be declared noexcept. I don't know what you are saying. a and AccessA() are diferent implementations that I am trying out and never used together. It has a handler so why wouldn't it be caught? It is caught when constructing obj. For obj's exception it is caught and the handler executes correctly and there is not another throw.
  5. Fraser

    cdecl

    I had discovered some of this. The documentation needs some correcting.
  6. For obj the initial message is Project X.exe raised exception class $std@logic_error with message 'Exception Object Address:0x2EAAE98'. For a the initial message is similar. Next there is Project X.exe raised exception class EExternalException with message 'Extrenal Exception EEFACE'. Next there is another before 'Abnormal program termination.'
  7. #include <vcl.h> #pragma hdrstop #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; class A { A() noexcept try { throw std::logic_error("test"); } catch (std::exception const &ex) { std::cout << "Caught an STL exception" << std::endl; } }; A a; A & AccessA() { static A obj; return obj; } //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- The throw is placed there as a deliberate test. The object a throws an exception and it gets caught by the handler but the CPU view shows that a function called clang terminate is called. The object obj throws an exception and it gets caught by the handler and the correct code is executed.
  8. Fraser

    cdecl

    I am not sure what is happening when I export functions with __cdecl. When I build with 32-bit clang there is one prefixed underscore on all function names. When I build with 64-bit clang there is no prefixed underscore on function names. The documentation says this about cdecl: "Note: This feature is available only for the classic bcc32 compiler, not for the modern Clang-enhanced compiler." It also says:"Note: The __cdecl form is the only one supported by C++Builder 64-bit Windows (BCC64)." Is this not a contradiction? The compiler option "Generate underscores on symbol names" made no difference to my 32-bit builds. I have not found any way of using cdecl with 32-bit builds and to not get leading underscores which means I cannot build zlib1.dll which specifies no underscores.
  9. Are there any open source projects for C++ Builder that could be used for this kind of problem?
  10. I've tried that and the bug has not materialised. Probably it requires a large project to appear.
  11. What appears to be required is a VCL project with an object declared at global scope that throws during construction and an appropriate catch statement in the constructor that will not catch the exception.
  12. An object is declared in a cpp file at namespace scope.
  13. If I have an object with static storage duration that throws an exception while constructing it is not caught by the expected catch statement. Instead there is an external exception EEFACE and 'Abnormal program termination' is reported. This only happens with a VCL application. The code would work otherwise. I have to have my object declared static in a function that returns it by reference in order that its construction will be delayed until after something clearly VCL related. This must be something that is known about. I am not providing example code because the requirements for this are described adequately. BTW this is not the undeterminable order of construction of objects of static storage duration problem.
  14. Fraser

    std::cbegin can return an iterator

    I've not had any reply from Dinkumware.
  15. Fraser

    std::cbegin can return an iterator

    The same problem occurs with std::cend. It is easily fixed by inserting const. I have reported this to Dinkumware.
×