visual studio - Equivalent of the GetTempPath on Windows Phone -
i compiling third party library libkml windows universal app. , notice following win32 api not available on winapi_partition_desktop
.
the following fileapi.h:
#if winapi_family_partition(winapi_partition_desktop) winbaseapi dword winapi gettemppathw( _in_ dword nbufferlength, _out_writes_to_opt_(nbufferlength, return + 1) lpwstr lpbuffer ); ... #endif
does know equivalent function gettemppath
windows store app , windows phone app?
here example gettemporarydirectory()
wrapper function taken following msdn blog article "writing shared code windows store , win32 desktop apps":
dual-use coding techniques games, part 3.
void gettemporarydirectory( wchar_t* dir, size_t maxsize ) { if ( !maxsize ) return; *dir = 0; #if !defined(winapi_family) || (winapi_family == winapi_family_desktop_app) dword nchars = gettemppath( maxsize, dir ); if ( nchars > 0 ) dir[nchars-1] = '\0'; // trim trialing '\' else *dir = 0; #else // windows store winrt app auto folder = windows::storage::applicationdata::current->temporaryfolder; wcscpy_s( dir, maxsize, folder->path->data() ); #endif // winapi_family_partition }
Comments
Post a Comment