06-27-2008 09:22 PM
06-28-2008 08:39 PM
please ignore the previous post as i make mistake with my question
the actual problem is as below.
IniFile = Ini_New(0);
MakePathname(StrPrjDir,"Temp.ini",StrFilePath);
if(Ini_ReadFromFile(IniFile,StrFilePath)==0);
{
strcat(StrDFFileDir,"\\"); strcat(StrDFFileDir,StrDFFileName);
fpFile = fopen (StrDFFileDir, "r");
if(fpFile!=NULL)
{
startRead = 1;
do
{
memset(StrBuffer, 0, 500);
sdata = fgets(StrBuffer, 500, fpFile);
if(!startRead)
{
if(sdata!=NULL)
{
for(i=0;i<12;i++)
{ ..........
}
strcpy(SectionName,"Penang:"); strcat(SectionName,StrText[1]);
if(Ini_SectionExists(IniFile,SectionName))
{
..............
if(dCompare2>dCompare)
{
for (i=0;i<11;i++)
Ini_PutRawString(IniFile,SectionName,Items[i],StrText[i]);
}
else if(dCompare2==dCompare)
{
if(dCompare2>dCompare)
{
for (i=0;i<11;i++)
Ini_PutRawString(IniFile,SectionName,Items[i],StrText[i]);
}
}
}
else
{
for (i=0;i<11;i++)
Ini_PutRawString(IniFile,SectionName,Items[i],StrText[i]);
}
...........
I had encounter dynamic memory is corrupted when the last Ini_PutRawString is executed. Does this problem related to the fopen and Ini_New()? As i used both ini file and txt file in the above instruction.
Anyone, please advise.
07-01-2008
01:48 PM
- last edited on
04-22-2025
11:48 AM
by
Content Cleaner
Hey popcorn,
I'm a bit confused now that you've asked two different questions. What is it exactly that you're trying to accomplish - reading from two INI files at the same time?
This help article describes the reasons why you'll receive a "Dynamic Memory is Corrupt" error message.
Perhaps it would be best to post a small example that I can run that demonstrates this error? The code you posted earlier uses a lot of variables and logic that I believe is not pertinent to replicating the issue. Could you create a small example and post the file to this thread so that I can replicate this on my machine?
07-02-2008 10:36 AM