Bug Report Q498143
Visible to All Users

An application fails to start if the ExpressPrinting settings cannot be restored from an INI file or the registry due to the denied access

created 12 years ago

During the creation of a form containing a TdxCustomContainerReportLink component, an exception was raised when processing the
LoadDefaultSettings method that is called from TdxPSPDFReportExportOptions.AfterConstruction.

The problem is that the settings are stored in an INI file, and the attempt to open the file fails.The exception is not caught so AfterConstruction fails which causes the TdxCustomContainerReportLink to be destroyed. This calls FreeAndNilDefinitions which referes to FDefinitions, which is nil. This causes another exception due to an AV.

As a result the form is not loaded from the DFM resource in the exe file.

I have attached a test project to illustrate.

To reproduce the problem.

Run the program.
Click the Preview button.
Changed the page setup from the preview form.
Close the preview form and close the program.

This should create a settings file. The name is hard coded in the dpr file as

'C:\Temp\PRINT_SETTINGS.INI'

You can change this to suit your environment.

Now, to cause the problem we need to provoke a file open failure. (In the real live app this wasa due to the file being opened by another process). The easiest way to force a file open failure is to change the file permissions so that your user does not have read permission.

Run the program again and you will see the file open exception followed by the access vioalation.

Ideally, the failure of the LoadDefaultSettings method should not cause the creation of the form to fail. The user should see a file open error message and the form should load.

I have attached a zip file with the small demo project, it also contains a madExcept bug report showing the stack trace at the time of the AV.

Comments (1)
DevExpress Support Team 12 years ago

    I have managed to reproduce this behavior. I am forwarding this issue to our developers for further processing. You will receive an automatic message once the status of this issue is changed.

    Answers approved by DevExpress Support

    created 12 years ago (modified 12 years ago)

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

      Comments (1)

        I have tried the hotfix and it works OK for me.
        Thank You.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.