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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Store name of MFC child form in string

Status
Not open for further replies.

eddiemjm

Programmer
Jan 28, 2004
4
IE
Newbie. I have a standard MFC application with which I can open .bmp files etc, on the top border the name of the file appears. How can I store the name of the current file that is open into a variable. Is it something to do with


#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


TRIED THIS (DOESN'T WORK):
??????
CString currentFile;
currentFile = __FILE__;
??????


I want to store it in a variable so that I can use the name of file as a ID in a database.

Any help would be much appreciated...
 
When I assign

fileName = __FILE__;

OR

fileName = THIS_FILE;

I get a run time error in a dialog box saying "String data, right truncated"

????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top