Get application path

I try to get application path, I need to open some files , which located in application dir, I try this, but this is not compile, how to get application name other method, or what's wrong :

char reportPath[MAX_PATH];
 wfsGetApplicationPath(reportPath);
 // change this to correct report
 strcat(reportPath, "test.rpt");
LVL 1
cybsashaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
chensuConnect With a Mentor Commented:
TCHAR pszBuf[_MAX_PATH];
::GetModuleFileName(NULL, pszBuf, sizeof(pszBuf) / sizeof(TCHAR));
*::_tcsrchr(pszBuf, _T('\\')) = _T('\0');
::lstrcat(pszBuf, _T("\\test.rpt"));
0
 
WynCommented:
Please,cybsasha and chensu:

Would you tell what the use of "_T"?

What is the _T  ?

Thank very much!!
Regards
Wyn


0
 
chensuCommented:
_T is a macro, which indicates a Unicode string if UNICODE is defined. Take a look at the Using Generic-Text Mappings topic of the Visual C++ documentation.
0
All Courses

From novice to tech pro — start learning today.