Board index » cppbuilder » Win-98 Registry

Win-98 Registry


2004-05-17 10:06:55 PM
cppbuilder23
Anyone know a good source of info about accessing the registry (Borland
5.02, Win-98SE) with example code. I'm fairly good at Borland CPP
generally, but have never tried accessing the regiistry before. Seems
difficult!
Hope this is the right place, I got no response from OWL so
that must have been the wrong place!
best wishes to all
Georges
 
 

Re:Win-98 Registry

I do not remember anything in OWL that handles the Registry.
Start the Windows help, win32.hlp
Click on the Index tab
Type Registry into the edit control
Click the Display button
You are at the starting page for information on the registry
Click the>>button repeatedly to page through it
Most of the pages are overviews or near-tutorials
Several of the pages have code, for example the
"Using the Registry" page
. Ed
Quote
nokomis wrote in message
news: XXXX@XXXXX.COM ...

Anyone know a good source of info about accessing the
registry (Borland 5.02, Win-98SE) with example code. I'm
fairly good at Borland CPP generally, but have never tried
accessing the regiistry before. Seems difficult!

Hope this is the right place, I got no response from OWL
so that must have been the wrong place!
 

Re:Win-98 Registry

Quote
Anyone know a good source of info about accessing the registry
(Borland
5.02, Win-98SE) with example code. I'm fairly good at Borland CPP
generally, but have never tried accessing the regiistry before.
Seems
difficult!

Hope this is the right place, I got no response from OWL so
that must have been the wrong place!
While not part of OWL, the "Borland WinSys Library" does define
registry classes (\include\winsys\registry.h). Look at winsys.hlp.
You can do stuff like this:
char buff[256];
char value[512];
uint32 size, type;
TRegKey my_key(TRegKey::GetClassesRoot(), "MyClass\\MyKey");
size = sizeof(value);
type = REG_SZ;
memset(buff, 0, sizeof(buff));
int index = 0;
while (my_key.EnumKey(index, buff, sizeof(buff)) ==
ERROR_SUCCESS){
index++;
TRegKey key(my_key, buff);
value[0] = 0;
size = sizeof(value);
if (key.QueryValue("VALUE1", &type, (uint8*)value, &size) ==
ERROR_SUCCESS){
strcpy(value, "another value");
size = lstrlen(value);
type = REG_SZ;
key.SetValue("VALUE2", type, (uint8*)value, size);
}
}
HTH,
Bruce
 

{smallsort}

Re:Win-98 Registry

nokomis wrote:
Quote
Anyone know a good source of info about accessing the registry (Borland
5.02, Win-98SE) with example code. I'm fairly good at Borland CPP
generally, but have never tried accessing the regiistry before. Seems
difficult!
Do you have WIN32.HLP on your system? Look in there in the index
under "registry" for info about using it. Also, example is in the find
tab under "Using the registry" (or several pages into the registry
topic.)
If you don't have that help file, it's available on the Borland site
in the same area as the free commandline compiler.
Doing a GREP on my system for RegOpenKey found examples in MS SDK.
{heavily edited}
RegOpenKey(HKEY_CLASSES_ROOT, szKey, &hKey);
RegQueryValue(hKey, "DefaultIcon", lpBuffer, &dw);
RegCloseKey(hKey);
 

Re:Win-98 Registry

"Ed Mulroy [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
I do not remember anything in OWL that handles the Registry.

>
There's the TRegKey class in OWL.
--
Marvin Avery
XXXX@XXXXX.COM
 

Re:Win-98 Registry

I did not remember anything in OWL that handles the registry. The
only thing with OWL that I have mounted right now is TC++ for Windows
4.5, for 16 bit Windows. I looked and the word TRegKey does not
appear in the header files for it.
. Ed
Quote
MarvinAvery wrote in message
news:40aa383f$ XXXX@XXXXX.COM ...

There's the TRegKey class in OWL.
 

Re:Win-98 Registry

"Ed Mulroy [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
I did not remember anything in OWL that handles the registry. The
only thing with OWL that I have mounted right now is TC++ for Windows
4.5, for 16 bit Windows. I looked and the word TRegKey does not
appear in the header files for it.

. Ed

I did further checking and ..... you're right!
TRegKey is in the include\syslib\registry.h header file. Which, I suppose,
strictly speaking, does not make it part of OWL. But it is part of BC5.02.
However, it is part of OWLNext residing in OWLNext's owl\registry.h header
file.
--
Marvin Avery
XXXX@XXXXX.COM
 

Re:Win-98 Registry

MarvinAvery wrote:
Quote
"Ed Mulroy [TeamB]" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
>I did not remember anything in OWL that handles the registry. The
>only thing with OWL that I have mounted right now is TC++ for Windows
>4.5, for 16 bit Windows. I looked and the word TRegKey does not
>appear in the header files for it.
>
>. Ed
>

I did further checking and ..... you're right!
TRegKey is in the include\syslib\registry.h header file. Which, I suppose,
strictly speaking, does not make it part of OWL. But it is part of BC5.02.
However, it is part of OWLNext residing in OWLNext's owl\registry.h header
file.

--
Marvin Avery
XXXX@XXXXX.COM
Many thanks for that extensive discussion - I expected that it would all be so
easy!
Not so it seems - Come Back 'GetPrivateProfileString' - all is forgiven!
Thanks again
Georges