This is my very first native extension between AIR and C++, and in C++ programming as well, so I am not sure where to look for help with type conversions.
From AIR side I receive a string in uint8_t (FRE... function call). I need to use this string for writing to registry, where wchar_t is expected. I am not sure if I can simply make a type casting, or make new wchar[] array of the same size and copy characters or do I need to use someting like MultiByteToWideChar() to convert UTF-8 characters to wchar_t. Im not sure about the correct size of output array in this case.
...
FREObject retObj = NULL;
uint32_t strLength = 0;
const uint8_t *path8 = NULL;
// this is what I get from actionscript call
FREResult status = FREGetObjectAsUTF8(argv[ARG_PATH], &strLength, &path8);
if ((status != FRE_OK) || (strLength <= 0) || (path8 == NULL)) return retObj;
LONG hStatus;
HKEY hKey;
wchar_t *path;
// ??? how to copy uint_t into wchar_t
hStatus = RegOpenKeyEx(HKEY_CURRENT_USER, path, 0, KEY_ALL_ACCESS, &hKey);
...