#include <shlwapi.h> BOOL CMyApp::InitInstance() { // ... TCHAR szIniPath[MAX_PATH]; VERIFY(::GetModuleFileName(::AfxGetInstanceHandle(), szIniPath, MAX_PATH) != 0); VERIFY(::PathRenameExtension(szIniPath, _T(".ini")) != FALSE); ::free(static_cast<LPVOID>(const_cast<LPTSTR>(m_pszProfileName))); m_pszProfileName = ::_tcsdup(szIniPath); // ... return TRUE; }
You need to create an account or log in to post comments to this site.