NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

fopen not working when called through dll

Hi, I created a DLL in c++ and fopen is returning NULL.  

 

I have a funciton called int openfile(char *filename), which returns a 1 on success and 0 when fopen returns NULL.  This function always returns a 0 when I run it in TestStand 4.2.1.  I did development of the DLL in Visual Studio 2013.

 

When I run this DLL using TestStand 2013 it works, but for this situation, I need to have the dll work in testStand 4.2.1 as well 

0 Kudos
Message 1 of 4
(6,104 Views)

It would probably be useful to enable debugging in your DLL to see what is going on. Microsoft Developer Network (MSDN) has several pages about enabling debugging in a C++ DLL: MSDN: Debugging DLL Projects

 

In your DLL, does TestStand pass the filename parameter to the DLL? Are there in errors in TestStand or do you just see the incorrect value (0)?

Taylor B.
National Instruments
0 Kudos
Message 2 of 4
(6,078 Views)

TestStand passes the filename parameter to the DLL.  I ended up fixing the problem by hard coding the filename into the function so everything is good now

0 Kudos
Message 3 of 4
(6,065 Views)

Hi, I am having the same issue although I already hardcoded my .csv file name. I am passing a string also but it is not a filename. I always get File could not be opened (fopen returns NULL) error. Do you have any suggestions for me?

Regards.

0 Kudos
Message 4 of 4
(2,396 Views)