// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>

using namespace std;

#define UNICODE
#define _UNICODE
#include <windows.h>
#include <tchar.h>

int main()
{
    cout << GetPrivateProfileInt(_T("Demo"), _T("NUM_ROWS"), 1, _T("C:\\demo.ini")) << endl;
    cout << GetPrivateProfileInt(_T("Demo"), _T("NUM_HUL"), 1, _T("C:\\demo.ini")) << endl;
    TCHAR buf[100];
    char buf2[100];
    GetPrivateProfileString(_T("Demo"), _T("SK5"), _T("*"), buf, sizeof(buf)/sizeof(TCHAR), _T("C:\\demo.ini"));
    wcstombs(buf2, buf, sizeof(buf2));
    cout << buf2 << endl;
    GetPrivateProfileString(_T("Demo"), _T("SK6"), _T("*"), buf, sizeof(buf)/sizeof(TCHAR), _T("C:\\demo.ini"));
    wcstombs(buf2, buf, sizeof(buf2));
    cout << buf2 << endl;
    return 0;
}
