I'm getting started with SQLite in my WinRT C++/CX application and I'm having a few problems.
First, on http://www.sqlite.org/c3ref/temp_directory.html it says that you have to set up the sqlite_temp_directory with the following code:
LPCWSTR zTempPath = Windows::Storage::ApplicationData::Current->TemporaryFolder->Path->Data();
char zTempPathBuf[MAX_PATH + 1];
memset(zTempPathBuf, 0, sizeof(zTempPathBuf));
WideCharToMultiByte(CP_UTF8, 0, zTempPath, -1, zTempPathBuf, sizeof(zTempPathBuf), NULL, NULL);
sqlite3_temp_directory = zTempPathBuf;
When I try to run this code, the last line causes a memory access violation :/