C Board  

Go Back   C Board > Platform Specific Boards > Windows Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 09-02-2009, 03:06 PM   #1
C/C++ Learner & Lover
 
Join Date: Aug 2008
Location: Argentina
Posts: 172
Using Windows Registry

Which library is used to manipulate the windows registry in c? Is it there any doc about it?
Thanks
lautarox is offline   Reply With Quote
Old 09-02-2009, 03:18 PM   #2
Registered User
 
Join Date: Sep 2004
Location: California
Posts: 2,845
Just use the Win32 registry API.
__________________
bit∙hub [bit-huhb] n. A source and destination for information.
bithub is offline   Reply With Quote
Old 09-02-2009, 04:13 PM   #3
C/C++ Learner & Lover
 
Join Date: Aug 2008
Location: Argentina
Posts: 172
But, don't you need a Microsoft Visual environment to use it?
lautarox is offline   Reply With Quote
Old 09-02-2009, 04:13 PM   #4
Registered User
 
Join Date: Sep 2004
Location: California
Posts: 2,845
I think you just need the platform SDK installed.
__________________
bit∙hub [bit-huhb] n. A source and destination for information.
bithub is offline   Reply With Quote
Old 09-02-2009, 04:20 PM   #5
C/C++ Learner & Lover
 
Join Date: Aug 2008
Location: Argentina
Posts: 172
Mmm.. I really don't know, I'm not a Windows native programmer, if I have the SDK installed, how can I include the libraries?
lautarox is offline   Reply With Quote
Old 09-02-2009, 04:27 PM   #6
Registered User
 
Join Date: Mar 2007
Posts: 69
Biggest problem with Registry API is the naming conventions, the names used for certain entities in the api. Be sure to understand that first. Then the rest will come much easier.

I remember staring at some example code and the documentation and I couldn't connect one with the other. I felt stupid very often while I was dealing with the registry.

Read this post by Raymond Chen and try to read the comments too.

---

I see while I was writing this, you two were talking about some very basic issues. You must have some C compiler for Windows? If you can't link the library to your exe, you can always use LoadLibrary() and GetProcAddress().

Last edited by idelovski; 09-02-2009 at 04:46 PM.
idelovski is offline   Reply With Quote
Old 09-02-2009, 04:28 PM   #7
Registered User
 
Join Date: Sep 2004
Location: California
Posts: 2,845
What compiler are you using?
__________________
bit∙hub [bit-huhb] n. A source and destination for information.
bithub is offline   Reply With Quote
Old 09-02-2009, 04:43 PM   #8
C/C++ Learner & Lover
 
Join Date: Aug 2008
Location: Argentina
Posts: 172
DJGPP, which one will you recommend me?
lautarox is offline   Reply With Quote
Old 09-02-2009, 04:48 PM   #9
Registered User
 
Join Date: Sep 2004
Location: California
Posts: 2,845
That appears to be a DOS compiler. I suggest you use MS Visual Studio Express which is free.
__________________
bit∙hub [bit-huhb] n. A source and destination for information.
bithub is offline   Reply With Quote
Old 09-02-2009, 05:05 PM   #10
C/C++ Learner & Lover
 
Join Date: Aug 2008
Location: Argentina
Posts: 172
Thanks, I'll take a look at it, it's a DOS compiler, but I was thinking to use GTK+ with it.. but well, I think I'll have to use the Visual Studio
lautarox is offline   Reply With Quote
Old 09-02-2009, 06:14 PM   #11
Guest
 
Sebastiani's Avatar
 
Join Date: Aug 2001
Posts: 4,923
The mingw port of gcc is also an excellent compiler for Windows, plus if you're using C++, it's more standard-compliant than the Microsoft compiler. At any rate, to use the API any Windows compiler will do - just include windows.h.
Sebastiani is offline   Reply With Quote
Old 09-02-2009, 09:18 PM   #12
Rampaging 35 Stone Welsh
 
abachler's Avatar
 
Join Date: Apr 2007
Posts: 2,929
Quote:
Originally Posted by lautarox View Post
But, don't you need a Microsoft Visual environment to use it?
If you have to ask that you definitely should not be messing witht eh registry.
__________________
He is free, you say. Ah! That is his misfortune… These men… [have] the most terrible, the most imperious of masters, that is, need. … They must therefore find someone to hire them, or die of hunger. Is that to be free? - Simon Linguet
abachler is offline   Reply With Quote
Old 09-03-2009, 04:18 AM   #13
Mysterious C++ User
 
Join Date: Oct 2007
Posts: 14,099
It's fine if storing and retrieving data.
__________________
Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System
I dedicated my life to helping others. This is only a small sample of what they said:
"Thanks Elysia. You're a programming master! How the hell do you know every thing?"
Quoted... at least once.
Quote:
Originally Posted by cpjust
If C++ is 2 steps forward from C, then I'd say Java is 1 step forward and 2 steps back.
Elysia is offline   Reply With Quote
Old 09-03-2009, 12:50 PM   #14
Rampaging 35 Stone Welsh
 
abachler's Avatar
 
Join Date: Apr 2007
Posts: 2,929
Quote:
Originally Posted by Elysia View Post
It's fine if storing and retrieving data.
The registry is not a scratch pad to save all your inane application specific data in.
__________________
He is free, you say. Ah! That is his misfortune… These men… [have] the most terrible, the most imperious of masters, that is, need. … They must therefore find someone to hire them, or die of hunger. Is that to be free? - Simon Linguet
abachler is offline   Reply With Quote
Old 09-03-2009, 01:08 PM   #15
Guest
 
Sebastiani's Avatar
 
Join Date: Aug 2001
Posts: 4,923
Quote:
Originally Posted by abachler View Post
The registry is not a scratch pad to save all your inane application specific data in.
Hmm. Maybe someone should have informed MS about that.

Seriously, though, I don't think Elysia was implying that. The purpose of the registry isn't just to provide a database for the system but in fact all applications. Naturally, there are probably some "common sense" exceptions that should be observed (for the sake of system performance, at least) such as not storing massive amounts of data there (eg: code, output from log files, etc), but using it to store important application settings and the like makes good sense for a number of reasons (more uniform access for your application, the system, other programs, etc, less complex logic for storing/retrieving database-centric data, etc). The main thing though, is just to be consistent, and to be very careful not to accidentally overwrite system-critical data, obviously.
Sebastiani is offline   Reply With Quote
Reply

Tags
registry, windows

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Network Programming in C for Windows m.mixon C Programming 7 06-19-2006 08:27 PM
Menu Item Caption - /a for right aligned Accelerator? JasonD Windows Programming 6 06-25-2003 11:14 AM
Manipulating the Windows Clipboard Johno Windows Programming 2 10-01-2002 09:37 AM
How come this only works in Windows nt/2000? Unregistered Windows Programming 1 08-30-2002 06:54 PM
Windows Registry Nor Windows Programming 1 02-15-2002 03:19 AM


All times are GMT -6. The time now is 10:35 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22