Solved

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

Posted on 2000-04-19
5
356 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
Comment Utility
Urgent
0
 
LVL 3

Accepted Solution

by:
GlennDean earned 20 total points
Comment Utility
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
Comment Utility
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
Comment Utility
That's only for older systems.  On NT and W98, it goes straight to the Registry.
   Glenn
0
 

Author Comment

by:devisri
Comment Utility
Thank you GlennDean & MT MU

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

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
VB.NET how to use the Vertical ScrollBar 5 86
Rewrite URL With Encoded Characters 6 64
ShiftLeft challenge 21 65
zeroMAx challenge 20 76
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now