Solved

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

Posted on 2000-04-19
5
367 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

803 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