Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to open file from C++ DLL

Tags:

c++

I have an application for which GUI is written in C# and the logic is written in C++ DLL. The DLL should open a file to read data from it. I have the data.txt file in the same folder as the DLL. When I call fopen("data.txt","r") the value returned is NULL. What could be the problem? Please help me in this regard.

Thanks, Rakesh.

like image 775
Rakesh K Avatar asked Jan 23 '23 12:01

Rakesh K


1 Answers

The location of the dll file is not relevant. The path of your open must contain the complete path or the file will be opened to your applications current working directory.

like image 194
DougS Avatar answered Feb 04 '23 02:02

DougS