// 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;

#include <afx.h>

int main()
{
   CString s = "ABC";
   LPWSTR res = new WCHAR[s.GetLength()];
   LPTSTR tmp = s.GetBuffer(s.GetLength());
   int n = MultiByteToWideChar(CP_ACP, 0, tmp, -1, NULL, NULL);
   MultiByteToWideChar(CP_ACP, 0, tmp, -1, res, n);
   for(int i = 0; i < 3; i++) cout << res[i] << endl;
   return 0;
}
