AR2 shows runtime error message even after setting ShowMessages to False (in VB6)

Posted by: stefan-tzanev on 4 August 2017, 2:54 pm EST

  • Posted 4 August 2017, 2:54 pm EST

    Dear Sirs,


    I try to raise a custom error from AR2 event handlers in a VB6 DLL component, and to catch the error in the same component.


    In the event handlers of my report I catch the error and I raise a custom (report-specific) error.


    In the function where I call Run on my report I also have an error handler and I try to catch the custom errors from the report's event handlers. I set report's ShowMessages to False before calling Run.


    In the function where I call Run, I manage to catch the custom report error only if it is raised from ActiveReport_Initialize. In all other cases AR2 pops up a runtime error dialog box. In these cases the execution in the caller function continues after the Run without an exception, but the report object is invalid. If I try to access a property (e.g., Status) I get an Automation error.


    In short, I could not find a way to use custom error messages from the report's event handlers and to suppress the AR2's runtime error messages. The state of ShowMessages shows as 'False', but the error message still pops up.


    I use VB6 in Windows XP SP2 (w/ all latest updates) and AR2 Standard edition with the latest update (ar2StdSP2.4.1.1283.exe).


    The source code of both VB6 test server (component) and VB6 test application is attached.


    I compile the component and run the application outside of the VB6 environment in purpose to avoid any side effects.


    I'll greatly appreciate your help. We experience the error handling problem on a commercial project (Windows service) at a customer site.


    Thank you.


    2006/05/ActiveReports - Error Handling.zip
  • Replied 4 August 2017, 2:54 pm EST

    Why not use the ActiveReport Error event?
    http://www.datadynamics.com/Help/AR2Std/HX_ActiveReport_Error.html
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels