Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a DLL that creates txt file...

Status
Not open for further replies.

arznrchrd

Technical User
May 17, 2006
234
US
Real newbie in the land of C++...need some guidance...

I have a standard win32 dll project created. I need to create a function in the dll that creates a txt file with no data to some directory.

I will call this from another program. No clue where to start...thanks...
 
Code:
#include <fstream>

using namespace std;

void CreateFile()
{
   ofstream file( "C:/somedirectory/filename.txt" );
}
 
You either need to define the function as:

Code:
_declspec(dllexport) void CreateFile()....

.. or define the export entry in .DEF file to be able to access the function from outside.

------------------
When you do it, do it right.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top