Click here to Skip to main content
15,895,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to write and save ini files like some apps do with their ini's Pin
ELY M.26-Dec-03 18:42
ELY M.26-Dec-03 18:42 
AnswerRe: how to write and save ini files like some apps do with their ini's Pin
ELY M.26-Dec-03 16:01
ELY M.26-Dec-03 16:01 
GeneralRe: how to write and save ini files like some apps do with their ini's Pin
shultas26-Dec-03 17:03
shultas26-Dec-03 17:03 
GeneralRe: how to write and save ini files like some apps do with their ini's Pin
ELY M.27-Dec-03 5:22
ELY M.27-Dec-03 5:22 
GeneralRe: how to write and save ini files like some apps do with their ini's Pin
shultas28-Dec-03 10:08
shultas28-Dec-03 10:08 
GeneralRe: how to write and save ini files like some apps do with their ini's Pin
ELY M.29-Dec-03 5:01
ELY M.29-Dec-03 5:01 
GeneralRe: how to write and save ini files like some apps do with their ini's Pin
ELY M.29-Dec-03 5:20
ELY M.29-Dec-03 5:20 
GeneralRe: how to write and save ini files like some apps do with their ini's Pin
ELY M.29-Dec-03 6:34
ELY M.29-Dec-03 6:34 
void CTESTINI2Dlg::OnDeletestring()
{
// TODO: Add your control notification handler code here



char sIniFile[MAX_PATH];
GetModuleFileName( NULL, sIniFile, MAX_PATH );
strcpy( strrchr( sIniFile, '\\' ) + 1, "strings.ini" );

/*

char curKey[80], keyName[80];
m_entries = 0;
while (1) {
sprintf(keyName,"n%d",m_entries);

GetPrivateProfileString("TEST",keyName,"DEFAULT",curKey,80,sIniFile);
if (strstr(curKey,"DEFAULT")) {

///MessageBox("Reached the top number...");

/*

CString text;
text.Format("%d", m_entries);
AfxMessageBox(text);
*/

/*
m_entries--;
break;
}
// populate whatever controls you want to here with the current values
m_entries++;

}
*/




int npick;
npick = m_list.GetCurSel();

char keyName[80];
m_list.GetWindowText(npick, keyName);


if(npick != CB_ERR)
{



WritePrivateProfileString("TEST", keyName, NULL, sIniFile);


}

}


Result:

Compiling...
TESTINI2Dlg.cpp
E:\-= IRC CLIENTS =-\TESTSTRINGS2\TESTINI2Dlg.cpp(416) : error C2664: 'int __thiscall CWnd::GetWindowTextA(char *,int) const' : cannot convert parameter 1 from 'char' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.

TESTINI2.exe - 1 error(s), 0 warning(s)





GeneralPostMessage Problem Pin
percyvimal25-Dec-03 18:00
percyvimal25-Dec-03 18:00 
GeneralRe: PostMessage Problem Pin
Monty225-Dec-03 20:39
Monty225-Dec-03 20:39 
GeneralCSingleLock Pin
Anonymous25-Dec-03 17:10
Anonymous25-Dec-03 17:10 
GeneralRe: CSingleLock Pin
Michael Dunn25-Dec-03 19:15
sitebuilderMichael Dunn25-Dec-03 19:15 
GeneralRe: CSingleLock Pin
Anonymous25-Dec-03 20:30
Anonymous25-Dec-03 20:30 
Questiondifference between ATL, MFC, and .NET Common Class? Pin
torrentmoon25-Dec-03 14:45
torrentmoon25-Dec-03 14:45 
AnswerRe: difference between ATL, MFC, and .NET Common Class? Pin
peterchen25-Dec-03 23:38
peterchen25-Dec-03 23:38 
GeneralRe: difference between ATL, MFC, and .NET Common Class? Pin
torrentmoon25-Dec-03 23:55
torrentmoon25-Dec-03 23:55 
GeneralRe: difference between ATL, MFC, and .NET Common Class? Pin
Jörgen Sigvardsson26-Dec-03 6:10
Jörgen Sigvardsson26-Dec-03 6:10 
GeneralMemory Leak When Invoke Web Service From VC++.net Using Autogen Proxy Class!! Pin
gpmn25-Dec-03 14:22
gpmn25-Dec-03 14:22 
GeneralRe: Memory Leak When Invoke Web Service From VC++.net Using Autogen Proxy Class!! Pin
gpmn25-Dec-03 14:27
gpmn25-Dec-03 14:27 
GeneralBest way to display a progressbar for file copying Pin
shultas25-Dec-03 13:04
shultas25-Dec-03 13:04 
GeneralRe: Best way to display a progressbar for file copying Pin
l a u r e n25-Dec-03 13:17
l a u r e n25-Dec-03 13:17 
GeneralRe: Best way to display a progressbar for file copying Pin
PJ Arends25-Dec-03 13:29
professionalPJ Arends25-Dec-03 13:29 
GeneralRe: Best way to display a progressbar for file copying Pin
shultas25-Dec-03 14:04
shultas25-Dec-03 14:04 
GeneralRe: Best way to display a progressbar for file copying Pin
shultas25-Dec-03 14:13
shultas25-Dec-03 14:13 
GeneralRe: Best way to display a progressbar for file copying Pin
PJ Arends25-Dec-03 14:36
professionalPJ Arends25-Dec-03 14:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.