Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6714563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:30:37+00:00 2026-05-26T08:30:37+00:00

I would like to store some XML program preferences as a resource in a

  • 0

I would like to store some XML program preferences as a resource in a Delphi application. The resource would be modified based on user changes. I have no problem creating the XML and loading it as a resource, and can modify the xmlDocument that I load it into, but I don’t know how to write the document back. Is this even possible? I would prefer not to end up with 2 files in the end (.exe and .xml).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:30:38+00:00Added an answer on May 26, 2026 at 8:30 am

    The answer is both yes and no.

    Yes, it is possible to update resources in a binary using Windows API routines. This link to BeginUpdateResource() should get you on the right track on that score.

    However, you will note the following condition on the use of BeginUpdateResource():

    “The binary file in which to update resources. An application must be
    able to obtain write-access to this file; the file referenced by
    pFileName cannot be currently executing.”

    In other words, it is not possible for an application to simply update it’s own resources while running.

    There are a number of strategies you could employ to achieve what you want – or something close enough to it as to be satisfactory. Which is most appropriate will depend on your precise needs.

    Of the multitude of solutions, two might be:

    1) Maintain all such resources in a DLL (resource only DLL – containing no actual code as such) which you open only when specifically loading resources (or updating them). Thus at the time you wish to write a resource back to the DLL you should be able to get the required write-lock.

    or

    2) When you need to update a resource rename the current running EXE to something like “myapp.OLD”, copy it so that you have a new file with the current name “myapp.exe”. You can then update “myapp.exe” because it is actually “myapp.old” that is executing.

    This second approach is quite messy and has a “nasty smell” but is a technique that is (or used to be) quite commonly used by auto-updaters, for example. Obviously will involve a restart of your app at some point if the current running code is to make use of the updated resources in the modified EXE, so it may not be appropriate to your needs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We would like to some processing in a Java application, store the results in
I would like to store log4net config data in my application.config file. Based on
I would like to store some information in xml format and query it whenever
i would like to know a good software engineering way to store user preferences
I use a byte to store some flag like 10101010 , and I would
For some small programs in Python, I would like to set, store and retrieve
I have this string stored in a variable: IN=bla@some.com;john@home.com Now I would like to
I have a certificate .p12 and .crt and I would like store the public
I would like to store the resource files (containing texts for labels etc.) for
I would like to perform a regex match on some XML content in JavaScript.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.