hey guys
I wanted to open the explorer images for an image and then use it as a profile picture.
I could do this in my draft wp8 native. But now when I click the button it gives me the following error: Platform::COMException ^ at memory location 0x01D3F56C.
my code:
void HelloWorld::menuCloseCallback(CCObject* pSender)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
using namespace Windows::Storage::Pickers;
using namespace Windows::Storage;
using namespace concurrency;
using namespace Platform;
using namespace Windows::Phone::Media::Capture;
Platform::String^ m_PickedFileName;
FileOpenPicker^ openPicker = ref new FileOpenPicker();
openPicker->ViewMode = PickerViewMode::Thumbnail;
openPicker->SuggestedStartLocation = PickerLocationId::PicturesLibrary;
openPicker->FileTypeFilter->Append("*");
create_task(openPicker->PickSingleFileAsync()).then([this](StorageFile^ file){
if (file){
StorageFolder^ localFolder = ApplicationData::Current->LocalFolder;
localFolder->CreateFolderAsync("profile");
create_task(localFolder->GetFolderAsync("profile")).then(
[file, localFolder, this](StorageFolder^ proFolder){
if (proFolder){
proFolder->CreateFolderAsync("pictures");
create_task(proFolder->GetFolderAsync("pictures")).then(
[file, proFolder, this](StorageFolder^ picFolder){
copyfile();
});
}
});
#else
CCDirector::sharedDirector()->end();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
exit(0);
#endif
#endif
}
the error occurs immediately at start of variable: “openPicker”.