Click here to Skip to main content
15,906,766 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: fractal Pin
Owner drawn3-Feb-06 0:25
Owner drawn3-Feb-06 0:25 
GeneralRe: fractal Pin
John R. Shaw3-Feb-06 0:41
John R. Shaw3-Feb-06 0:41 
GeneralRe: fractal Pin
Owner drawn3-Feb-06 0:46
Owner drawn3-Feb-06 0:46 
GeneralRe: fractal Pin
John R. Shaw3-Feb-06 1:54
John R. Shaw3-Feb-06 1:54 
AnswerRe: fractal Pin
Owner drawn3-Feb-06 1:22
Owner drawn3-Feb-06 1:22 
AnswerRe: fractal Pin
David Crow3-Feb-06 4:36
David Crow3-Feb-06 4:36 
QuestionHow to Insert & Get BLOBs into MSDE Pin
Shoaib Patel2-Feb-06 20:59
Shoaib Patel2-Feb-06 20:59 
QuestionWorking with INI Related functions Pin
swaapu2-Feb-06 20:17
swaapu2-Feb-06 20:17 
Hi! iam working on an mfc sdi project in which , i hav to read ini file and to change it into its corresponding xml file.
I am doing it with the help of
GetPrivateProfileSectionNAmes and
GetPrivateProfileSection functions.
My sample ini file is:
[SECTION1]
KEY1=500
KEY2=VALUE
[SECTION2]
key3=500
key4=100
[SECTION3]
key5=xyz

My code is like dis:

void CNewIni2XmlDlg::OnBConvert()
{
// TODO: Add your control notification handlcode here
FILE *fpr,*fpw;
CHAR buffer[50];
DWORD nSize=50;
LPTSTR lpszReturnBuffer;
CHAR buff[50];
fpr = fopen("C:\\users\\SG\\SWATI.INI","r");
fpw = fopen("C:\\users\\SG\\Ss.txt","w");

lpszReturnBuffer = buff;
fprintf(fpw,"");

GetPrivateProfileSectionNames(buffer,nSize,"C:\\users\\SG\\SWATI.INI");
fprintf(fpw,"\n<%s>",buffer);
fflush(fpw);

GetPrivateProfileSection(buffer,buff,nSize,"C:\\users\\SG\\SWATI.INI");
fprintf(fpw,"\n%s",buff);

fclose(fpr);
fclose(fpw);
AfxMessageBox("ok");
}

Now, the problem is , this method is returning only the SECTION1 and KEY1=500.
##How to get names of all the remaining sections??
##What should , I do to get all the key value pairs for any section??

Thanx a lot for ur kind support.

"If you change then change for the good."
AnswerRe: Working with INI Related functions Pin
_anil_2-Feb-06 20:31
_anil_2-Feb-06 20:31 
GeneralRe: Working with INI Related functions Pin
swaapu2-Feb-06 20:36
swaapu2-Feb-06 20:36 
GeneralRe: Working with INI Related functions Pin
_anil_2-Feb-06 21:06
_anil_2-Feb-06 21:06 
GeneralRe: Working with INI Related functions Pin
swaapu2-Feb-06 21:56
swaapu2-Feb-06 21:56 
GeneralRe: Working with INI Related functions Pin
_anil_2-Feb-06 22:06
_anil_2-Feb-06 22:06 
GeneralRe: Working with INI Related functions Pin
swaapu2-Feb-06 22:25
swaapu2-Feb-06 22:25 
GeneralRe: Working with INI Related functions Pin
_anil_2-Feb-06 22:32
_anil_2-Feb-06 22:32 
GeneralRe: Working with INI Related functions Pin
swaapu2-Feb-06 22:39
swaapu2-Feb-06 22:39 
GeneralRe: Working with INI Related functions Pin
_anil_2-Feb-06 23:34
_anil_2-Feb-06 23:34 
GeneralRe: Working with INI Related functions Pin
swaapu5-Feb-06 20:12
swaapu5-Feb-06 20:12 
GeneralRe: Working with INI Related functions Pin
alleyes24-Jul-09 4:45
professionalalleyes24-Jul-09 4:45 
AnswerRe: Working with INI Related functions Pin
Jagadeesh VN2-Feb-06 20:34
Jagadeesh VN2-Feb-06 20:34 
GeneralRe: Working with INI Related functions Pin
swaapu2-Feb-06 20:43
swaapu2-Feb-06 20:43 
GeneralRe: Working with INI Related functions Pin
Jagadeesh VN2-Feb-06 20:51
Jagadeesh VN2-Feb-06 20:51 
AnswerRe: Working with INI Related functions Pin
John R. Shaw2-Feb-06 21:59
John R. Shaw2-Feb-06 21:59 
QuestionRun-Time Check Failure #3 Pin
newbie53452-Feb-06 20:15
newbie53452-Feb-06 20:15 
AnswerRe: Run-Time Check Failure #3 Pin
John R. Shaw2-Feb-06 23:19
John R. Shaw2-Feb-06 23:19 

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.