jeudi 30 avril 2015

File access with C++ on WindowsPhone 8.1 Silverlight

My project use to be a WP8.1 WRT project -> C++ + Xmal,

Now I convert it into a WP8.1 Silverlight project - C# + Xmal + C++DLL.

Because I must use Silverlight and C++(openssl) at the same time.

This is how I access the file in the WP8.1 WRT project

For file in assets:

wchar_t pw_filedir[MAX_PATH];

wcscpy_s( pw_filedir, MAX_PATH, Windows::ApplicationModel::Package::Current->InstalledLocation->Path->Data() );
wcscat_s( pw_filedir, MAX_PATH, L"\\Assets\\FileName" );
// Then I can do file access with C style

For file in Isolate storage

wchar_t pw_filedir[MAX_PATH];
wcscpy_s( pw_filedir, MAX_PATH, Windows::Storage::ApplicationData::Current->LocalFolder->Path->Data() );
wcscat_s( pw_filedir, MAX_PATH, L"\\FileName" );
// Then I can do file access with C style

Now both of them no longer works on WP8.1 Silverlight.

Did any of you try to access file on WindowsPhone silverlight?

Here I mean:

Project - WP8.1 SL (C#)
Dll - WP8.1 SL native Dll (C++)

So I need to do a C++ file access in a native DLL in a WP8.1 SL C# project..

I'll appreciate a lot for the answers!

Aucun commentaire:

Enregistrer un commentaire