Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

input a file using a c++ DLL

This may be a stupid question to most...but I have not been able to figure it out.   I'm writing a dll in c++.  I want to read from a file, so I do what I have always done:
 
#include <fstream.h>
...some code...
//inside a function
ifstream fin;
fin.open("myfile.txt");
 
string temp;
fin>>temp;
cout<<temp;
 
everything runs just fine, but nothing is printed to the screen.  I have stepped through the code and when temp is read in, "" is what appears in temp.  It's almost as if nothing is held in my file.  The .txt file is in the same directory as the program calling the dll.  Hope this can be a simple answer...thanks in advance.
 
T-Hawk
 
 
0 Kudos
Message 1 of 2
(3,069 Views)
Nevermind...figured it out.  Normal ifstream and ofstreams now are working.
0 Kudos
Message 2 of 2
(3,063 Views)