|
|
Ok, I get it now, but we are suppost to be helping and not entertaining our selfs. A simple statement of "look it up" would do.
You remind me of someone that a friend of mine thought I would get along with, and that guy thought the statement "I have problems with comparing floating point values" was funny. I told him, straight faced, that I did not have that problem. Of course it did not occure to me, until later, that he was talking about direct comparison ("=="), that's just foolish.
I do not think like that! Here is a simple one (in C++), what is wrong with this: "i++".
INTP
Every thing is relative...
|
|
|
|
|
No you don't! You have an assignment or some thing! Wait a second, that is a project. It is just one that has not been written yet. In my lap is a "Dictionary of Computer Terms", which contains a QBASIC program for drawing snowflakes, if I grabed a standared dictionary off my bookshelf or looked at an encyclopidia, I would probably find the same information.
Please do not ask questions here, before you have researched them. There is lots of information on factals on the Web, and many programs with source available.
INTP
Every thing is relative...
|
|
|
|
|
How do you pronouce that name...I am trying my best...
Owner drawn
Jesus Loves
|
|
|
|
|
|
That's a set of digits. How can it be his name.
But it's a tough name to call.
Owner drawn
Jesus Loves
|
|
|
|
|
Sorry, but your humor failed. (ignore the spelling, I am realy asleep and imagining all of this)
I just read your bio (I was born in 1960) and I was just wondering if you've realized yet, that all those old men who said that they forgot more than you know, where not kidding.
INTP
Every thing is relative...
|
|
|
|
|
John R. Shaw wrote: but your humor failed. (ignore the spelling, I am realy asleep and imagining all of this)
Yeah, could be. I found it too long.
John R. Shaw wrote: I just read your bio (I was born in 1960) and I was just wondering if you've realized yet, that all those old men who said that they forgot more than you know, where not kidding.
Why are you commenting about that here.
Owner drawn
Jesus Loves
|
|
|
|
|
Owner drawn wrote: Why are you commenting about that here
Didn't you read my side bar? I am asleep, I just looked at the window and realised that the sun is coming up. Besides, I thought I was asking a question and not commenting on anything (my mistake).
After all your answer to the original question was not and answer. But on the other hand, the question was not realy a question.
INTP
Every thing is relative...
|
|
|
|
|
|
dokhtarakekebritfroosh wrote: i don't know about fractal
See here.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hi guys, Iam very frustrated at this stage & I want help.
Iam working on a project its in MFC (Visual Studio 2005), the backend is MSDE.I have a table called Files the design is as follows
Files(FileID int,FileData text,..);
Iam supposed to accept the file name from user & store the file details into the DB. The problem is that how to store the file data into DB.
can any one tell me whether the FileData field should be text,ntext or image.
Also how to read data back from DB.
please send me ur suggestions & codes at
patel.shoaib@gmail.com
Thanks.
|
|
|
|
|
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."
|
|
|
|
|
I suggest to check the buffer again after this statement.
GetPrivateProfileSectionNames(buffer,nSize,"C:\\users\\SG\\SWATI.INI");
fprintf(fpw,"\n<%s>",buffer);
you might be getting all the names but problem is in the fprintf statemet. fprintf will end at the first occurance of a null charachetr.
but GetPrivateProfileSectionNames fill the buffers with section names separated with null characters and the last one with two null characters.
|
|
|
|
|
Hello Anil!
But, I need more help. Could u Plz tell me how should i write in the file, if with fprintf, it is not possible. I am new to VC++.
Thanx a lot
"If you change then change for the good."
|
|
|
|
|
don't know XML at all.
tell me in which format do you want?
I changed your program as I guess your requirment.
FILE *fpr,*fpw;
CHAR buffer[50];
DWORD nSize=50;
LPTSTR lpszReturnBuffer;
CHAR buff[50];
fpr = fopen("C:\\SWATI.INI","r");
fpw = fopen("C:\\Ss.txt","w");
lpszReturnBuffer = buff;
fprintf(fpw,"");
memset(buffer, 0x00, 50);
GetPrivateProfileSectionNames(buffer,nSize,"C:\\SWATI.INI");
char* pBuffer = buffer;
int nWrite = 0;
while(strlen(pBuffer) > 0){
nWrite = fprintf(fpw,"\n<%s>",pBuffer);
memset(buff, 0x00, 50);
GetPrivateProfileSection(pBuffer,buff,nSize,"C:\\SWATI.INI");
char* pBuff = buff;
int nWrt = 0;
while(strlen(pBuff) > 0){
nWrt = fprintf(fpw,"\n%s",pBuff);
pBuff = pBuff + nWrt;
}
pBuffer = pBuffer + nWrite - 2;
fflush(fpw);
}
fclose(fpr);
fclose(fpw);
AfxMessageBox("ok");
|
|
|
|
|
Hello Anil!! I m providing u here with a sample ini file and its converted form in XML.
For Ini File:
[SECTION1]
KEY1=500
KEY2=VALUE
[SECTION2]
KEY3=500
KEY4=100
[SECTION3]
KEY5=XYZ
This is the XML format:
<section1>
<key1>500
<key2>VALUE
<section2>
<key3>500
<key4>100
<section3>
<key5>xyz
Thanx a lot for ur so kind support.Bye
"If you change then change for the good."
|
|
|
|
|
Try to understand the above code.
There are lots of way to do. May be you are new to VC thats why getting problem.
the format you posted is not right as <> are not displayed.
Change the above code, if not able to do then ask again.
|
|
|
|
|
Hi!!
The above code is also not working.
Wat to do now?
Thanx
"If you change then change for the good."
|
|
|
|
|
mail me the output format
if you post it then click the ignore HTML tags and then post.
or modify your previous post with HTML tag ignored.
|
|
|
|
|
Hi!!
For INI file:
[SECTION1]
KEY1=500
KEY2=VALUE
[SECTION2]
KEY3=500
KEY4=100
[SECTION3]
KEY5=xyz
The corresponding XML file would be:
<SECTION1>
<KEY1>500</KEY2>
<KEY2>VALUE</KEY2>
</SECTION1>
<SECTION2>
<KEY3>500</KEY3>
<KEY4>100</KEY4>
</SECTION1>
<SECTION3>
<KEY5>xyz</KEY5>
</SECTION3>
"If you change then change for the good."
|
|
|
|
|
Try this one...
{
FILE *fpr,*fpw;
CHAR buffer[50];
DWORD nSize=50;
LPTSTR lpszReturnBuffer;
CHAR buff[50];
fpr = fopen("C:\\SWATI.INI","r");
fpw = fopen("C:\\Ss.txt","w");
lpszReturnBuffer = buff;
fprintf(fpw,"");
memset(buffer, 0x00, 50);
GetPrivateProfileSectionNames(buffer,nSize,"C:\\SWATI.INI");
char* pBuffer = buffer;
int nWrite = 0;
while(strlen(pBuffer) > 0){ // For all Section Name
nWrite = fprintf(fpw,"\n<%s>",pBuffer); // Print the SectionName < SECTION >
memset(buff, 0x00, 50);
GetPrivateProfileSection(pBuffer,buff,nSize,"C:\\SWATI.INI");
char* pBuff = buff;
int nWrt = 0;
while(strlen(pBuff) > 0){ // For all KEY=VALUE
CString strToken;
strToken = pBuff; // The the KEY with Value "KEY=VALUE"
// Find the = character inside the string
INT nPosEql = strToken.Find('=');
if(nPosEql == -1){
break;
}
CString strKey = strToken.Left(nPosEql); // Get the Key
CString strVal = strToken.Mid(nPosEql + 1); // Get the value
fprintf(fpw, "\t\n<%s>", strKey); // Print <KEY>
fprintf(fpw, "%s", strVal); // Print VALUE
fprintf(fpw, "</%s>", strKey); // Print </KEY>
pBuff = pBuff + strlen(pBuff) + 1; // Move to next key
}
fprintf(fpw,"\n</%s>",pBuffer); // Print the </SECTION>
pBuffer = pBuffer + strlen(pBuffer) + 1; //Move to next section
}
fclose(fpr);
fclose(fpw);
}
|
|
|
|
|
Hi!!!!!!!!!!!!
Yes, it`s working.
Thanx a lot for ur kind support.
"If you change then change for the good."
|
|
|
|
|
I have to create a console text menu that is written from values from an INI file.
The menu entry would be something like:
1) Pencil
2) Pen
3) Typwriter
Select choice -->
The INI file has
[Writing Tools]
1 = Pencil
2 = Pen
3 = Typewriter
Can you modify the example to create a buffer (or array of struct) that uses this? I don't need values written to an output file.
Thanks
Jer 29:11
|
|
|
|
|
The output buffer from GetPrivateProfileSectionNames is filled with all the section names and are seperated by a null character. The last section name is followed by two null characters. Similarly output buffer in GetPrivateProfileSection is also filled with all the key name, value pairs seperated by null character.
So modify your program accordingly...
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
XMinds
|
|
|
|
|