Click here to Skip to main content
15,899,314 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: MFC and Global Variables :How can i access them ? Pin
Christian Graus23-Nov-05 11:28
protectorChristian Graus23-Nov-05 11:28 
AnswerRe: MFC and Global Variables :How can i access them ? Pin
ThatsAlok28-Nov-05 17:39
ThatsAlok28-Nov-05 17:39 
QuestionHow to set LPT ? to read and write byte Pin
quangpk23-Nov-05 5:33
quangpk23-Nov-05 5:33 
AnswerRe: How to set LPT ? to read and write byte Pin
khan++23-Nov-05 23:08
khan++23-Nov-05 23:08 
GeneralRe: How to set LPT ? to read and write byte Pin
quangpk1-Dec-05 6:35
quangpk1-Dec-05 6:35 
QuestionHow to read and write data to File's section Pin
Loc Milkyway23-Nov-05 4:51
Loc Milkyway23-Nov-05 4:51 
AnswerRe: How to read and write data to File's section Pin
ThatsAlok28-Nov-05 17:06
ThatsAlok28-Nov-05 17:06 
GeneralRe: How to read and write data to File's section Pin
Loc Milkyway29-Nov-05 2:42
Loc Milkyway29-Nov-05 2:42 
Thank you for advice. The class and demo are good. But I don't know how to use GetInt(...). I made a simple GUI with 1 button and i edit box, when button is clicked, the key value should be displayed on edit box. But default value is displayed. Something is wrong I could not figure out.

Here is my
ini file contains

[SECTION1]
Key1 = String
Key2 = 14

[SECTION2]
Key1 = 20.5
Key2 = a


simple GUI contains

void CsimpleINIfileTestDlg::OnBnClickedButton4()//open file
{
CString Str; //ok here
Str = "3"; //ok here
m_ebSECT1KEY2.SetWindowText(Str); //ok here - 3 is displayed on edit box

CFileDialogEx dlg(TRUE, _T("ini"), NULL, /*OFN_HIDEREADONLY | */ OFN_OVERWRITEPROMPT,
_T("Ini Files (*.ini)|*.ini|All Files (*.*)|*.*||"),
this);

if (dlg.DoModal() == IDOK)

char m_sSectionX[]= "SECTION1";
char m_sKEYX[] = "KEY2";
Str.Format(_T("%d \n"), m_ini.GetInt(m_sSectionX , m_sKEYX, 7, BASE_DECIMAL));
m_ebSECT1KEY2.SetWindowText(Str);

/* always get value 7 - result as 4 above lines
CString m_sSection = _T("SECTION1"); //m_sSection will be destroyed by next line CString m_sKEY = _T("KEY2");
CString m_sKEY = _T("KEY2");
Str.Format(_T("%d \n"), m_ini.GetInt(_T("SECTION1"), _T("KEY2"), 7, BASE_DECIMAL));
m_ebSECT1KEY2.SetWindowText(Str);
*/
}

MilkyWay
GeneralRe: How to read and write data to File's section Pin
ThatsAlok29-Nov-05 17:41
ThatsAlok29-Nov-05 17:41 
GeneralRe: Thank you Pin
Loc Milkyway30-Nov-05 3:25
Loc Milkyway30-Nov-05 3:25 
QuestionMouse click Simulation ? Pin
kendao23-Nov-05 3:50
kendao23-Nov-05 3:50 
AnswerRe: Mouse click Simulation ? Pin
khan++23-Nov-05 22:58
khan++23-Nov-05 22:58 
AnswerRe: Mouse click Simulation ? Pin
ThatsAlok28-Nov-05 16:53
ThatsAlok28-Nov-05 16:53 
QuestionText Capture Problem. Pin
Jewel Nandy23-Nov-05 2:51
Jewel Nandy23-Nov-05 2:51 
AnswerRe: Text Capture Problem. Pin
BlackDice23-Nov-05 11:11
BlackDice23-Nov-05 11:11 
AnswerRe: Text Capture Problem. Pin
ThatsAlok28-Nov-05 20:58
ThatsAlok28-Nov-05 20:58 
Question<queue> queue threadsafe? Pin
Pixinger7723-Nov-05 2:02
Pixinger7723-Nov-05 2:02 
AnswerRe: <queue> queue threadsafe? Pin
Tim Smith23-Nov-05 3:56
Tim Smith23-Nov-05 3:56 
GeneralRe: <queue> queue threadsafe? Pin
Pixinger7723-Nov-05 20:00
Pixinger7723-Nov-05 20:00 
QuestionIncreasing of Header column of CList Control Pin
mikobi23-Nov-05 1:08
mikobi23-Nov-05 1:08 
AnswerRe: Increasing of Header column of CList Control Pin
Blake Miller23-Nov-05 9:40
Blake Miller23-Nov-05 9:40 
GeneralRe: Increasing of Header column of CList Control Pin
mikobi23-Nov-05 19:22
mikobi23-Nov-05 19:22 
QuestionAdd menu to dialog window Pin
Frank Reich23-Nov-05 0:48
Frank Reich23-Nov-05 0:48 
AnswerRe: Add menu to dialog window Pin
ThatsAlok27-Nov-05 17:44
ThatsAlok27-Nov-05 17:44 
QuestionWM_QUERYENDSESSION message Pin
Chintoo72323-Nov-05 0:43
Chintoo72323-Nov-05 0:43 

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.