Solved

Difference between RegSetValueEx() & WriteProfileString()/WriteProfileInt()?

Posted on 2000-04-19
5
369 Views
Last Modified: 2013-11-20
Hi,

 i would like to know the difference between RegSetValueEx() and the WriteProfileString() functions.
I want to use the settings of one application and modify the same settings using another application.
How do I do that...?
How do I set the application1 settings in application2. Which function call should I use?

Thank you

0
Comment
Question by:devisri
  • 2
  • 2
5 Comments
 

Author Comment

by:devisri
ID: 2732809
Urgent
0
 
LVL 3

Accepted Solution

by:
GlennDean earned 20 total points
ID: 2732835
Hi:
   WriteProfileString, for one, calls RegSetValueEx.  WriteProfileString writes a key to a particular place where RegSetValueEx is used to write to any spot in the Registry.  For ex., when you call WriteProfileString it stores a "Name/Value" at, in the default case, HKEY_CURRENT_USER\Software\LocalAppWizard-GeneratedApplications\yourAppName\Settings.
  Once WriteProfileString opens the above key in the Registry, it'll use RegSetValueEx to set the "Name/Value" pair that you passed to WriteProfileString.
   From App2, you can set App1's setting by simply opening the appropriate key and calling RegSetValueEx yourself.
  Glenn
0
 
LVL 1

Expert Comment

by:MT_MU
ID: 2732842
RegSetValueEx writes to the Registry, WriteProfileString write to WIN.INI.

You could technically use either method to share setting between applications.

WriteProfileString is easier - RegSetValueEx is probably the preferred method.
0
 
LVL 3

Expert Comment

by:GlennDean
ID: 2732850
That's only for older systems.  On NT and W98, it goes straight to the Registry.
   Glenn
0
 

Author Comment

by:devisri
ID: 2735194
Thank you GlennDean & MT MU

I obeserved that without using SetRegistryKey(..) function, on  Win98,
WriteProfileString() writes to WIN.INI
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
viewing source code from eclipse 13 110
sum13 challenge 24 123
My project did see openJDK that I installed. What could be the problem 7 152
Message not shown 5 67
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question