Results 1 to 3 of 3

Thread: Writing to registry

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2002
    Posts
    10

    Writing to registry

    I am trying to write to the registry. I can create a key, but not a value. can someone tell me what is wrong with this code?

    Code:
                    HKEY hkey;
    		DWORD dmDisposition;
    		
    		RegCreateKeyEx( HKEY_LOCAL_MACHINE, TEXT("Software\\My Company\\My App"), 0, 0, 0, 0, 0, &hkey, &dmDisposition );
    
    		DWORD dwType, cbData;
    		BYTE m_dwMaxFileSize;
    
    		dwType = REG_SZ;
    		cbData = sizeof(REG_SZ);
    
    		RegSetValueEx( hkey, TEXT("MaxFileSize"), 0, dwType, (PBYTE)"hi", cbData );
    	
    		RegCloseKey(hkey);

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    Check out the attached cpp/h files.
    Attached Files Attached Files

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2002
    Posts
    10
    thx works great

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width