Unable to access file from C++ library through C# UWP

狂风中的少年 提交于 2019-12-13 02:25:16

问题


I have an application for which GUI is written in C# UWP and accessing the file logic is written in C++ DLL. The DLL should open a file to read data from it. I am trying to access the file from its location. When I call inFile.open("D:\\File\\readFile.txt", ios::in) the value returned is NULL.

To check if there is any problem with the file path, I have created a console application to access the file using the same way and it worked. What could be the problem?

fstream inFile;
inFile.open(filePath, ios::in);
if (!inFile.is_open()) 
{
    /* Display unable to read file*/
    return;
}

/* Perform operation on file */
inFile.close();

来源:https://stackoverflow.com/questions/52096546/unable-to-access-file-from-c-library-through-c-sharp-uwp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!