none
Writing to and loading from registry with CByteArray

    Question

  • How do I write a CByteArray type to a registry and load it again? 
    Here is what I tried. Writing was was ok and but loading cannot type case and get a compilation error.

    // saving CByteArray to registry
    CByteArray arBytes;
    ...
    pApp->WriteProfileInt(_T("MyRegSection"), _T("MyEntry"), (int)arBytes.GetData());
    
    
    // loading CByteArray from registry
    CByteArray arBytes;
    arBytes = (const unsigned char*)pApp->GetProfileIntA(_T("MyRegSection"), _T("MyEntry"),0);



    Tuesday, October 20, 2009 1:32 PM

Answers

  • Thanks for the reply.

    I found that there are following APIs (MFC).

    WriteProfileBinary
    GetProfileBinary
    • Marked as answer by TimKim Thursday, October 22, 2009 2:23 AM
    Tuesday, October 20, 2009 3:50 PM

All replies