Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


cоnvert parаmeter

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
karter
How do I cheat?
Reputation: 0

Joined: 18 Mar 2008
Posts: 5

PostPosted: Tue Mar 18, 2008 8:06 pm    Post subject: cоnvert parаmeter Reply with quote

Hi all. Help me solve few such a mistаkes.
Code:
   if ((status = RegQueryValueEx(hkey, "config", 0, NULL, config, &config_size)) != ERROR_SUCCESS) {
      SetLastError(status);
      winerr("RegOpenKeyEx");
      goto cleanup;
   }

'RegQueryValueExA' : cannot convert parameter 5 from 'char *' to 'LPBYTE'

Code:
   if ((status = RegSetValueEx(hkey, "config", 0, REG_SZ, config, strlen(config) + 1)) != ERROR_SUCCESS) {
      SetLastError(status);
      winerr("RegSetValueEx");
      goto done;
   }

'RegSetValueExA' : cannot convert parameter 5 from 'const char *' to 'const BYTE *'
Back to top
View user's profile Send private message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Tue Mar 18, 2008 8:08 pm    Post subject: Re: cоnvert parаmeter Reply with quote

Code:
   if ((status = RegQueryValueEx(hkey, "config", 0, NULL, (LPBYTE)config, &config_size)) != ERROR_SUCCESS) {
      SetLastError(status);
      winerr("RegOpenKeyEx");
      goto cleanup;
   }


Code:
   if ((status = RegSetValueEx(hkey, "config", 0, REG_SZ, (BYTE*)config, strlen(config) + 1)) != ERROR_SUCCESS) {
      SetLastError(status);
      winerr("RegSetValueEx");
      goto done;
   }


I don't even know if it'll work or not...

_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
karter
How do I cheat?
Reputation: 0

Joined: 18 Mar 2008
Posts: 5

PostPosted: Tue Mar 18, 2008 9:27 pm    Post subject: Reply with quote

yea, thanks, it worked.
But here this does not work, why? in italics
g_dispatcher = lib_CreateThread(NULL, 0, (LPVOID)dispatcher, (LPVOID)config, 0, &thread_id);

'_beginthreadex' : cannot convert parameter 3 from 'LPVOID' to 'unsigned int (__stdcall *)(void *)'
Back to top
View user's profile Send private message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Tue Mar 18, 2008 9:36 pm    Post subject: Reply with quote

Code:
g_dispatcher = lib_CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)dispatcher, (LPVOID)config, 0, &thread_id);
[/code]
_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Tue Mar 18, 2008 9:40 pm    Post subject: Reply with quote

Quote:
Code:
(LPTHREAD_START_ROUTINE)dispatcher

&dispatcher
Back to top
View user's profile Send private message
karter
How do I cheat?
Reputation: 0

Joined: 18 Mar 2008
Posts: 5

PostPosted: Tue Mar 18, 2008 10:09 pm    Post subject: Reply with quote

cannot convert parameter 3 from 'LPTHREAD_START_ROUTINE' to 'unsigned int (__stdcall *)(void *)'
Back to top
View user's profile Send private message
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Tue Mar 18, 2008 10:28 pm    Post subject: Reply with quote

is dispatcher a void function?
Back to top
View user's profile Send private message
karter
How do I cheat?
Reputation: 0

Joined: 18 Mar 2008
Posts: 5

PostPosted: Wed Mar 19, 2008 12:06 am    Post subject: Reply with quote

DWORD WINAPI
dispatcher(LPVOID param)
{
..etc...
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Mar 19, 2008 12:52 am    Post subject: Reply with quote

are you trying to read a registry key?
Code:
void Boners(void){
   HKEY hKey = NULL;
   TCHAR strValue[4];   
   DWORD dwData = 0,
        dwSize,
        dwType = REG_DWORD;

      if(RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Example\\Example"),
                  0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS){

            RegQueryValueEx(hKey, _T("Example Key Name"), NULL, &dwType, (LPBYTE)strValue, &dwSize);
            dwData = (BYTE)strValue[0];
            //Do whatever you want with it now, SetDlgItemText / Int, etc.
            RegCloseKey(hKey);
}
Back to top
View user's profile Send private message
karter
How do I cheat?
Reputation: 0

Joined: 18 Mar 2008
Posts: 5

PostPosted: Wed Mar 19, 2008 2:23 am    Post subject: Reply with quote

slovach wrote:
are you trying to read a registry key?

No, my code renew parameters from config-file.
Code:
DWORD WINAPI
dispatcher(LPVOID param)
{
   char *config = (char *)param;
   HANDLE handles[2];
   DWORD i, n;

   handles[0] = g_event;
   handles[1] = g_exit_event;

   for (;;) {
      if (!DeviceIoControl(g_device, IOCTL_CMD_GETREQUEST, NULL, 0,
         g_disp_buf, DISP_BUF_SIZE, &n, NULL)) {
         winerr("dispatcher: DeviceIoControl");
         break;
      }
.......

But I do't know how to convert parameter.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites