Compartilhar via


CWinApp::m_pszProfileName

Contém o nome do arquivo .ini do aplicativo.

LPCTSTR m_pszProfileName;

Comentários

m_pszProfileName é uma variável pública do tipo const char*.

Dica

Se você atribui um valor a m_pszProfileName, deve ser atribuído dinamicamente no heap.O destrutor de CWinApp chama free( ) com esse ponteiro.Muitos você deseja usar a função da biblioteca em tempo de execução de _tcsdup( ) para fazer alocar.Além de isso, liberar memória associado com o ponteiro atual antes de atribuir um novo valor.Por exemplo:

//First free the string allocated by MFC at CWinApp startup. 
//The string is allocated before InitInstance is called.
free((void*)m_pszProfileName);
//Change the name of the .INI file. 
//The CWinApp destructor will free the memory.
m_pszProfileName = _tcsdup(_T("c:\\somedir\\myini.ini"));

Requisitos

Cabeçalho: afxwin.h

Consulte também

Referência

Classe de CWinApp

Gráfico da hierarquia

CWinApp::GetProfileString

CWinApp::GetProfileInt

CWinApp::WriteProfileInt

CWinApp::WriteProfileString