Registry

Blitz3D Forums/Blitz3D Programming/Registry

Rambus(Posted 2003) [#1]
I have game data (like the players name) stored in the registry, (Put there from the game launcher made outside of blitz) Now how do I retrieve the information from the registry? I see no registry command in the command library.


Rambus(Posted 2003) [#2]
anyone?

If blitz3d cant do it... Is there a DLL for it?
common some one gimmy some luvin!


darklordz(Posted 2003) [#3]
We have userlibs these days and with windows api nothing is impossible....

try playing around with this
.lib "advapi32.dll"

RegOpenKeyEx%(hKey%,lpszSubKey$,dwReserved%,samDesired%,phkResult):"RegOpenKeyExA"
RegQueryValueEx%(hKey%,lpszValueName$,lpdwReserved%,lpdwType%,lpbData,lpcbData):"RegQueryValueExA"


i didn feel like writing teh blitz code just remember that lpbData,lpcbData and phkResult are pointers to a memory buffer so use banks and peekbyte those banks....

if you wanted i could create a dll that could write/read/delete regkeys


Rambus(Posted 2003) [#4]
Im having a hard time figuering out what each of those variables are, Could you rewrite that code with example values placed in?
thx


Rambus(Posted 2003) [#5]
darklordz I wub you
*Bump*
Could you explain it a little better?
thx


eBusiness(Posted 2003) [#6]
Why do you have such data in the registry?


Tracer(Posted 2003) [#7]
hey, eBusiness, i tried downloading your racing game from your new site... 1.15kb/sec? lol.. kinda slowish my man :)

On topic: don't store stuff like that in the registry, unless it's for registration purposes.

Tracer


darklordz(Posted 2003) [#8]
Dear GOD,

Im pleased to hear from you so soon. I have heard that you're having trouble with the registry stuff and solving the hunger problems in third world countries. I will try and help you as soon as possible. Im kinda busy right now but im sure i'll get to it tomorrow.

Kind Regards,
darklordz


Rob(Posted 2003) [#9]
Yeah I agre with darklordz for once.


ChrML(Posted 2003) [#10]
I would use a DLL for this registry stuff if you're using Blitz3D. Here's a simple sample on how to do that in Delphi:

Uses
  ...registry;
...
Function WriteToRegistry(key,value,newvalue:string)
var
  reg: Tregistry;
begin
  reg := Tregistry.Create;
  reg.RootKey := HKEY_LOCAL_MACHINEL; //Or any other root
  reg.OpenKey := key;
  reg.WriteString(value,newvalue)
  reg.Destroy;
end;


I haven't tested this code yet, but it should work. If you have delphi, use that code. If you have VB, use some other code. Blitz3D cannot write to the registry by itself.


darklordz(Posted 2003) [#11]
@ChrML & Rest
Dll & UserLib Comming up. As i said i would post some code soon but i started off making a dll and i put in a whole bunch of functions not just registry will post very soon.....


Rambus(Posted 2003) [#12]
I wub you darklorz