Jump to content


Photo

REG WRITE STRING DLL


  • This topic is locked This topic is locked
3 replies to this topic

#1 gameside

gameside

    GMC Member

  • GMC Member
  • 123 posts

Posted 19 February 2012 - 01:50 PM

Hi there!
i made a DLL using pure basic which Write String value in registry it has 4 arguments
argument0[HKey],argument1[Subkey],argument2[String],argument3[Value]
but the problem is when i run the game nothing happening i checked registry editor no value was written in registry. :wacko:

here is my the Pure basic source
;-========= Write String to Registry ============
ProcedureDLL RegWriteString(HKMain,HKSub$,HKEntry$,HKValue.s) 
If RegCreateKeyEx_(HKMain, HKSub$, 0, 0, #REG_OPTION_NON_VOLATILE, #KEY_ALL_ACCESS, 0, @NewKey, @KeyInfo)= #ERROR_SUCCESS
  RegSetValueEx_(NewKey, HKEntry$, 0, #REG_SZ, @HKValue,256)
  RegCloseKey_(NewKey)
EndIf
EndProcedure

and this is DLL define in game maker
:GM070:
global.myfunction=external_define("test.dll","RegWriteString", dll_stdcall, ty_string, 4, ty_string ,ty_string,ty_string,ty_string)
external_call(global.myfunction,argument0,argument1,argument2,argument3)

and in create event
:GM123:
//Creat event
scr_dll("#HKEY_CURRENT_USER","Software\app1\Data1","Data0000","test")

i dont know what i did wrong with the code, :confused: please help me can some one make it correct i am really serous. :wallbash:

Edited by gameside, 19 February 2012 - 01:54 PM.

  • 0

#2 iam1me

iam1me

    GMC Member

  • GMC Member
  • 380 posts
  • Version:GM8

Posted 19 February 2012 - 04:56 PM

Your not suppose to talk about messing with the registry in this forum (I don't think any of the forums allow it actually)
  • 0

#3 gameside

gameside

    GMC Member

  • GMC Member
  • 123 posts

Posted 20 February 2012 - 04:15 AM

Your not suppose to talk about messing with the registry in this forum (I don't think any of the forums allow it actually)


thanks iam1me i knew that registry is not allowed in this form. :sad: but i am learning purebasic to build dll for game maker and this is a problem that i face i just want some one help me to make correct my code,please help me!!!! :confused:
  • 0

#4 ugriffin

ugriffin

    Idiot

  • Global Moderators
  • 1583 posts
  • Version:Mac

Posted 20 February 2012 - 07:21 AM

The topic is about modifying the registry. Plus these are the Game Maker forums, not the purebasic forums.

Topic locked.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users