"03 Data ADO" demo error
Here it is:
default_xxm
An error occurred while rendering this page. xxm://demo/ EAccessViolation Access violation at address 03C13E29 in module 'xxmLocalDev.dll'. Read of address F28B562B QueryString: Post data: none
This is after I fixed a pair of compilation errors. The first was covered in a previous issue:
https://github.com/stijnsanders/xxm/issues/1
The 2nd compilation error was an "undeclared identifier: s" in xxmSession.pas - the TXxmSession.Create constructor. An easy fix by adding a "var s:AnsiString;".
I have both D7 & XE8 on this machine; XE8 is doing the compiling.
When using the xxm binaries from the website (built with D7) and having a more recent version like XE8 build your xxm projects (into the xxl file), it will work just fine except when a Delphi Exception wants to travel across module boundaries. Since exception handling between (these) versions is binary incompatible, it results in an access violation, that gets shown instead of the original exception. There are a few optional solutions, ordered here by being most recommended first:
- Download the xxm source and use the same Delphi version to build xxm binaries from source. This has the added benifit that you can build for 64-bits of you want. (If any warnings/hints/errors arise, please let me know here since I don't have the resources to test the build on all Delphi versions prior to release.)
- Add the
IXxmProjectEvents1interface to the project object defined inxxmp.pasand haveHandleExceptiondisplay and/or handle the exception suiting to your needs (but don't raise a new exception from there!) It was specifically created for this purpose, with only string arguments. - Prevent exceptions from crossing the module boundary, by using custom 'proto' templates: copy the
bin\protofolder into your xxm project folder, and modify thexxm.pasandxxmi.pasfiles to enclose the[[FragmentBody]]placeholder inside of atry/exceptclause that displays and/or handles any exception in a way that suits your needs, but doesn't re-raises it. - Prevent exceptions from crossing the module boundary by applying discipline and enclosing any sensitive logic in self-made exception handling yourself, preventing exceptions getting raised outside of the page or fragment.
I fixed the missing var s:AnsiString; but need to check later if it's missing in other xxmSession.pas files throughout the xxm project... Thank you.