Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ version Alexandria crashes but building with Tokyo 10.2 works fine #35

Open
dan27125 opened this issue Feb 26, 2023 · 4 comments
Open

Comments

@dan27125
Copy link

C++ version Alexandria compiled for 32 bit crashes but Tokyo 10.2 works fine. i.e. Building 32 bit APPs with Tokyo 10.2 works fine.
Can someone help me fix the Alexandria package?

I have a high volume outbound Fax Server APP that was built 20 years ago using C++ Builder 6 and a AsyncPro. I recently got the app to compile and run OK using C++Builder/Rad studio version 10.2 Tokyo.

When built with C++ version Alexandria the app crashes immediately. I have spent several days trying to use Alexandria. I'm the Alexandria package files from AsyncPro-master.zip from here on github. First I open the runtime package AsyncProCR. I set the platform to 32 bit release. It compiles just fine. Next I close the runtime package. Next I open the open the development package. I set the platform to 32 bit release. It compiles just fine. Next I add the package by going to Component | Install Package. I maneuver to C:\Users\Public\Documents\Embarcadero\Studio\22.0\BPL I select AsyncProCD280.bpl (D for design) The package installs fine.
Next I close the Package. Next I open my outbound fax app.

Next to overcome compiler error E2109 Not an allowed type in a number of places within AdFax.hpp. As a temporary workaround I'm manually editing AdFax.hpp by simply changing "__published:" to public: in a number of places. The app compiles fine but it crashes immediately when you send a test fax.

I have a different parent folder for all of the files when I'm trying to use Alexandria vs Tokyo 10.2. When I use C++ version Tokyo 10.2 everything works fine. (Note: I'm a paying Embarcadero customer with a subscription so I can run any version of Rad studio. I have tried all versions of Alexandria. Results are the same. It crashes immediately when you send a test fax.

I'm a C/C++ programmer with very little Delphi Pascal experience. I'm not sure how to debug / fix this this. It using using the exact same Asyncpro source folder pascal files. Other then the Rad Studio compiler version The only difference are the package files Alexandria vs Tokyo. This is a 32 bit app.

Maybe my HPP header file fix is not really fixing things ? Maybe there is a structure alignment size problem ? Or maybe its something else? Maybe there is something wrong in the Alexandria package ?

Does anybody have any clues, tips or suggestions to troubleshoot and fix this ?

What about fixing the E2109 Not an allowed type in a number of places within AdFax.hpp?

Best regards

Dan
C/C++ Software engineer
Saint Louis Missouri USA

@romankassebaum
Copy link
Contributor

I'm not a C++ specialist, so that I do not know how to fix this. I would suggest that you contact David Millington from Embarcadero, he knows everything about the C++ Builder.

@dan27125
Copy link
Author

dan27125 commented Mar 1, 2023 via email

@dan27125
Copy link
Author

dan27125 commented Mar 1, 2023 via email

@romankassebaum
Copy link
Contributor

A string[255] is a so called ShortString. The first byte of this string, which is at the position 0, contains the length of it. Since it is only a byte, the length is limited to 255.

The biggest differnce to a LongString, which uses the keyword "string" is, that ShortStrings are AnsiStrings, whereas LongStrings are Unicode Strings.

Unicode Strings have been introduce with Delphi 2009, so that in the year 2006 with Delphi 2005 LongStrings were still AnsiStrings.

If you would now change a declaration from a ShortString to a LongString, you have to ensure that you fix all Move, FillChar, GetMem and casts to a PAnsiChar statements.

If the String only contains bytes, then TBytes which is an array of bytes, would be a better choice.

I cannot imagine that the C++Builder has problems with ShortStrings, but to be sure, you should ask David Millington.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants