Solved

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

Posted on 2000-04-19
5
375 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

724 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