Problem with binary Registry I/O
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: Problem with binary Registry I/O

Threaded View

  1. #1
    Join Date
    May 2002
    Posts
    1,727

    Problem with binary Registry I/O

    I have used the following code to attempt to place a binary array into and then retrieve from the Registry. I am a member of the local Administrator group. I have verified that the Registry for the app has a binary array 32 bytes in length under the key "settings" / "keyb" ab 12 cd ...

    Code:
    // in header 
    	unsigned char m_key[32];
    	int m_nKeySize;
    
    // in implmentation
    
    // int ctor
    		AfxGetApp()->GetProfileBinary(_T("settings"), _T("keyb"), (LPBYTE*)&m_key, (UINT*)&m_nKeySize);
    
    
    // in OnDestroy
    		AfxGetApp()->WriteProfileBinary(_T("settings"), _T("keyb"), (LPBYTE)&m_key, m_nKeySize );
    Here is a copy of the binary array in the Registry:
    7D DE 2B 30 E7 06 12 AC 99 60 8C 26 21 FC 8E 5B 66 DB 72 9E A2 00 BE 15 E1 8B 67 31 E5 EC 8B 15

    Here is the binary key retrieved from the Registry using the code above:

    D0 EB 26 00 CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC

    What am I doing wrong here?
    Last edited by Mike Pliam; February 12th, 2013 at 02:23 AM.
    mpliam

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center