Can somebody help me?
-
Is anyone to able send me a working example of this article? http://msdn.microsoft.com/library/en-us/sysinfo/regapi\_0tq1.asp?frame=true Unfortunly, I know C++ to bad to compile it myself. Thanks a lot! PS. sorry for my english. ============== www.design.kg
-
Is anyone to able send me a working example of this article? http://msdn.microsoft.com/library/en-us/sysinfo/regapi\_0tq1.asp?frame=true Unfortunly, I know C++ to bad to compile it myself. Thanks a lot! PS. sorry for my english. ============== www.design.kg
All you need to do is create a dialog class that contains the appropriately named list boxes and copy and paste this function. If you're not capable of that you should NOT be touching code that plays with the registry. If you really can't create a dialog based project and copy/paste some code, I'd be happy to advise you, but I'm serious about how seriously you can screw Windows if you play with the Registry and don't know what you're doing. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
All you need to do is create a dialog class that contains the appropriately named list boxes and copy and paste this function. If you're not capable of that you should NOT be touching code that plays with the registry. If you really can't create a dialog based project and copy/paste some code, I'd be happy to advise you, but I'm serious about how seriously you can screw Windows if you play with the Registry and don't know what you're doing. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
Of cource I can do it all, how do you think, if I'll be on this forum if I can't create a dialog box? When I compile it, VC create some errors as: : error C2660: 'SetDlgItemTextA' : function does not take 3 parameters : error C2660: 'SetDlgItemInt' : function does not take 4 parameters : error C2664: 'void __thiscall CWnd::GetDlgItem(int,struct HWND__ ** ) const' : cannot convert parameter 1 from 'struct HWND__ *' to 'int' : error C2660: 'SendMessageA' : function does not take 4 parameters : error C2664: 'RegEnumKeyExA' : cannot convert parameter 4 from 'const int' to 'unsigned long *' : error C2664: 'void __thiscall CWnd::GetDlgItem(int,struct HWND__ ** ) const' : cannot convert parameter 1 from 'struct HWND__ *' to 'int' : error C2660: 'SendMessageA' : function does not take 4 parameters : error C2660: 'MessageBoxA' : function does not take 4 parameters : error C2664: 'void __thiscall CWnd::GetDlgItem(int,struct HWND__ ** ) const' : cannot convert parameter 1 from 'struct HWND__ *' to 'int' : error C2660: 'SendMessageA' : function does not take 4 parameters : fatal error C1004: unexpected end of file found :(( that way ... And I thought that it will be easy for me to see ready project, becourse I speek english wery bad ... and it will be easy to look throo ready sample. best regrads ... ============== www.design.kg
-
Of cource I can do it all, how do you think, if I'll be on this forum if I can't create a dialog box? When I compile it, VC create some errors as: : error C2660: 'SetDlgItemTextA' : function does not take 3 parameters : error C2660: 'SetDlgItemInt' : function does not take 4 parameters : error C2664: 'void __thiscall CWnd::GetDlgItem(int,struct HWND__ ** ) const' : cannot convert parameter 1 from 'struct HWND__ *' to 'int' : error C2660: 'SendMessageA' : function does not take 4 parameters : error C2664: 'RegEnumKeyExA' : cannot convert parameter 4 from 'const int' to 'unsigned long *' : error C2664: 'void __thiscall CWnd::GetDlgItem(int,struct HWND__ ** ) const' : cannot convert parameter 1 from 'struct HWND__ *' to 'int' : error C2660: 'SendMessageA' : function does not take 4 parameters : error C2660: 'MessageBoxA' : function does not take 4 parameters : error C2664: 'void __thiscall CWnd::GetDlgItem(int,struct HWND__ ** ) const' : cannot convert parameter 1 from 'struct HWND__ *' to 'int' : error C2660: 'SendMessageA' : function does not take 4 parameters : fatal error C1004: unexpected end of file found :(( that way ... And I thought that it will be easy for me to see ready project, becourse I speek english wery bad ... and it will be easy to look throo ready sample. best regrads ... ============== www.design.kg
mmmmmmmmmmmmmmmmmmmmm :-) That's what happens when you copy/paste API code into MFC projects. tell you what, all those places where you got errors prefix the function call with :: That should remove these bugs :-) Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
-
Of cource I can do it all, how do you think, if I'll be on this forum if I can't create a dialog box? When I compile it, VC create some errors as: : error C2660: 'SetDlgItemTextA' : function does not take 3 parameters : error C2660: 'SetDlgItemInt' : function does not take 4 parameters : error C2664: 'void __thiscall CWnd::GetDlgItem(int,struct HWND__ ** ) const' : cannot convert parameter 1 from 'struct HWND__ *' to 'int' : error C2660: 'SendMessageA' : function does not take 4 parameters : error C2664: 'RegEnumKeyExA' : cannot convert parameter 4 from 'const int' to 'unsigned long *' : error C2664: 'void __thiscall CWnd::GetDlgItem(int,struct HWND__ ** ) const' : cannot convert parameter 1 from 'struct HWND__ *' to 'int' : error C2660: 'SendMessageA' : function does not take 4 parameters : error C2660: 'MessageBoxA' : function does not take 4 parameters : error C2664: 'void __thiscall CWnd::GetDlgItem(int,struct HWND__ ** ) const' : cannot convert parameter 1 from 'struct HWND__ *' to 'int' : error C2660: 'SendMessageA' : function does not take 4 parameters : fatal error C1004: unexpected end of file found :(( that way ... And I thought that it will be easy for me to see ready project, becourse I speek english wery bad ... and it will be easy to look throo ready sample. best regrads ... ============== www.design.kg
Karavaev Denis wrote: how do you think, if I'll be on this forum if I can't create a dialog box? Well, you *did* say Unfortunly, I know C++ to bad to compile it myself.. You'd be amazed at some of the questions we get around here. Most are intelligent but some are just out of control. C1004 means you either didn't put a final bracket, or you didn't include stdafx.h. The missing bracket is at the end. The HANDLE parameter should be a HKEY. Where the code checks if retValue == ERROR_SUCCESS, it should check for != ERROR_NO_MORE_ITEMS. Where it passes in MAX_PATH to RegEnumValues, it should set a DWORD to = MAX_PATH, pass in a pointer to that variable, and reset the variable to MAX_PATH. I think that was all, but my code follows to make sure. This smaple is SCREWED.
#define MAX_VALUE_NAME 255
// QueryKey - enumerates the subkeys of a given key and the associated
// values and then copies the information about the keys and values
// into a pair of edit controls and list boxes.
// hDlg - dialog box that contains the edit controls and list boxes
// hKey - key whose subkeys and values are to be enumeratedVOID QueryKey(HWND hDlg, HKEY hKey)
{
CHAR achKey[MAX_PATH];
CHAR achClass[MAX_PATH] = ""; // buffer for class name
DWORD cchClassName = MAX_PATH; // length of class string
DWORD cSubKeys; // number of subkeys
DWORD cbMaxSubKey; // longest subkey size
DWORD cchMaxClass; // longest class string
DWORD cValues; // number of values for key
DWORD cchMaxValue; // longest value name
DWORD cbMaxValueData; // longest value data
DWORD cbSecurityDescriptor; // size of security descriptor
FILETIME ftLastWriteTime; // last write timeDWORD i, j; DWORD retCode, retValue; CHAR achValue\[MAX\_VALUE\_NAME\]; DWORD cchValue = MAX\_VALUE\_NAME; CHAR achBuff\[80\]; // Get the class name and the value count. RegQueryInfoKey(hKey, // key handle achClass, // buffer for class name &cchClassName, // length of class string NULL, // reserved &cSubKeys, // number of subkeys &cbMaxSubKey, // longest subkey size &cchMaxClass, // longest class string &cValues, // number of
-
Karavaev Denis wrote: how do you think, if I'll be on this forum if I can't create a dialog box? Well, you *did* say Unfortunly, I know C++ to bad to compile it myself.. You'd be amazed at some of the questions we get around here. Most are intelligent but some are just out of control. C1004 means you either didn't put a final bracket, or you didn't include stdafx.h. The missing bracket is at the end. The HANDLE parameter should be a HKEY. Where the code checks if retValue == ERROR_SUCCESS, it should check for != ERROR_NO_MORE_ITEMS. Where it passes in MAX_PATH to RegEnumValues, it should set a DWORD to = MAX_PATH, pass in a pointer to that variable, and reset the variable to MAX_PATH. I think that was all, but my code follows to make sure. This smaple is SCREWED.
#define MAX_VALUE_NAME 255
// QueryKey - enumerates the subkeys of a given key and the associated
// values and then copies the information about the keys and values
// into a pair of edit controls and list boxes.
// hDlg - dialog box that contains the edit controls and list boxes
// hKey - key whose subkeys and values are to be enumeratedVOID QueryKey(HWND hDlg, HKEY hKey)
{
CHAR achKey[MAX_PATH];
CHAR achClass[MAX_PATH] = ""; // buffer for class name
DWORD cchClassName = MAX_PATH; // length of class string
DWORD cSubKeys; // number of subkeys
DWORD cbMaxSubKey; // longest subkey size
DWORD cchMaxClass; // longest class string
DWORD cValues; // number of values for key
DWORD cchMaxValue; // longest value name
DWORD cbMaxValueData; // longest value data
DWORD cbSecurityDescriptor; // size of security descriptor
FILETIME ftLastWriteTime; // last write timeDWORD i, j; DWORD retCode, retValue; CHAR achValue\[MAX\_VALUE\_NAME\]; DWORD cchValue = MAX\_VALUE\_NAME; CHAR achBuff\[80\]; // Get the class name and the value count. RegQueryInfoKey(hKey, // key handle achClass, // buffer for class name &cchClassName, // length of class string NULL, // reserved &cSubKeys, // number of subkeys &cbMaxSubKey, // longest subkey size &cchMaxClass, // longest class string &cValues, // number of
Than you very much for your underasanding :) but ... one more: : error C2664: 'void __thiscall CWnd::GetDlgItem(int,struct HWND__ ** ) const' : cannot convert parameter 1 from 'struct HWND__ *' to 'int' this error I get with your code? Is I did wrong something again? ============== www.design.kg
-
mmmmmmmmmmmmmmmmmmmmm :-) That's what happens when you copy/paste API code into MFC projects. tell you what, all those places where you got errors prefix the function call with :: That should remove these bugs :-) Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
Nish, while this is the cause of his last problem, this MSDN article had serious, serious problems - it simply would not work as it appears in MSDN. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
Than you very much for your underasanding :) but ... one more: : error C2664: 'void __thiscall CWnd::GetDlgItem(int,struct HWND__ ** ) const' : cannot convert parameter 1 from 'struct HWND__ *' to 'int' this error I get with your code? Is I did wrong something again? ============== www.design.kg
For some reason it knows to call ::GetDlgItem for me, but for you it's trying the CWnd:: function of the same name. Preface the function with :: and you'll be fine. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now