Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Can somebody help me?

Can somebody help me?

Scheduled Pinned Locked Moved C / C++ / MFC
c++comdesignhelptutorial
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Karavaev Denis
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • K Karavaev Denis

      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

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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

      K 1 Reply Last reply
      0
      • C Christian Graus

        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

        K Offline
        K Offline
        Karavaev Denis
        wrote on last edited by
        #3

        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

        N C 2 Replies Last reply
        0
        • K Karavaev Denis

          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

          N Offline
          N Offline
          Nish Nishant
          wrote on last edited by
          #4

          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

          C 1 Reply Last reply
          0
          • K Karavaev Denis

            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

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            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 enumerated

            VOID 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 time

            DWORD 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
            
            K 1 Reply Last reply
            0
            • C Christian Graus

              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 enumerated

              VOID 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 time

              DWORD 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
              
              K Offline
              K Offline
              Karavaev Denis
              wrote on last edited by
              #6

              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

              C 1 Reply Last reply
              0
              • N Nish Nishant

                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

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0
                • K Karavaev Denis

                  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

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #8

                  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

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups