Solved

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

Posted on 2000-04-19
5
370 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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
Perl Awk Need Help 3 137
matchUp  challenge 6 76
Making an alias 7 110
How do I get Window Title of all opened process? 4 32
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

735 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