Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

TppThemeManager.SavePreferences

edited May 2014 in General
Seems to always write to an INI file even though our Designer is set to
save to registry. As such our users can get the following exception
occasionally:

exception class : EFCreateError
exception message : Cannot create file "C:\Documents and
Settings\mrandall\Local Settings\Application
Data\RBuilder\RBuilder.ini". The process cannot access the file because
it is being used by another process.

Comments

  • edited May 2014
    Hi Tom,

    In a simple test here I cannot reproduce the issue. I reviewed the source
    code and traced with the debugger but do not find any issues. In
    ppEndUsr.pas there is a TppDesigner.ConfigureIniStorage method that setup up
    the storage type. In ppToolbarTBX there is a TppThemeManager.SavePreferences
    method that uses the registered storage type.

    Try tracing the RB source for the above methods in the Delphi debugger.
    Perhaps there is a timing issue.


    Best regards,

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited May 2014
    Nard Moseley (Digital Metaphors) wrote:


    Hi Nard,

    we're having same problems but not everytime on closeing the designer!

    It is appearing sometimes and sometimes not. It seems that the Designer
    is blocking the file by it self somewhere ...

    --
  • edited May 2014
    You might check your app and make sure you're not using multiple
    TppDesigners that have different IniStorageType or IniStorageName values.
    That might cause a conflict.

    I need either a simple example that demonstrates the issue or steps to
    reproduce. The code in question has been in place for years - so perhaps a
    rare case. Or might be memory corruption somewhere in the app, which can
    cause weird errors to appear - I've had this happen several times. Only way
    to fix that type of error is to use FastMM with full debug settings to
    monitor all of the memory buffers.




    Best regards,

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
    --

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited May 2014
    On 02/05/2014 18:05, Nard Moseley (Digital Metaphors) wrote:

    Ah, of course it is. I'm calling ...

    TppThemeManager.SetCurrentTheme('Office2007');

    in the "initialization" section of the unit that hosts my TppDesigner.
    Presumably I can move it to the form's OnCreate event?
  • edited May 2014

    That looks like it will work, give it a try.


    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited May 2014
    On 06/05/2014 18:08, Nard Moseley (Digital Metaphors) wrote:

    It does :)

    Ta.
This discussion has been closed.