Click here to Skip to main content
15,915,328 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Adding File names to list box. Pin
prasad_som20-Dec-06 20:53
prasad_som20-Dec-06 20:53 
GeneralRe: Adding File names to list box. Pin
Suresh H20-Dec-06 21:10
Suresh H20-Dec-06 21:10 
Questionprevent renaming an exe when it is running in windows Pin
seemadavid20-Dec-06 20:22
seemadavid20-Dec-06 20:22 
AnswerRe: prevent renaming an exe when it is running in windows Pin
nutkase20-Dec-06 20:28
nutkase20-Dec-06 20:28 
GeneralRe: prevent renaming an exe when it is running in windows Pin
seemadavid20-Dec-06 21:41
seemadavid20-Dec-06 21:41 
AnswerRe: prevent renaming an exe when it is running in windows Pin
Waldermort20-Dec-06 21:39
Waldermort20-Dec-06 21:39 
GeneralRe: prevent renaming an exe when it is running in windows Pin
seemadavid21-Dec-06 0:59
seemadavid21-Dec-06 0:59 
QuestionUnhandled exception at .... Pin
Programm3r20-Dec-06 20:11
Programm3r20-Dec-06 20:11 
Hi all,

I receive the following error:
Unhandled exception at 0x0045b287 in updCnf32.exe. 0xC0000005: Access violation writing location 0x00666e63.

Code (xutilty : compiler open this file):
inline void __CLR_OR_THIS_CALL _Container_base::_Orphan_all() const
	{	// orphan all iterators
	_Lockit _Lock(_LOCK_DEBUG);
	if (_Myfirstiter != _IGNORE_MYITERLIST)
		{
		for (_Iterator_base **_Pnext = (_Iterator_base **)&_Myfirstiter;
			*_Pnext != 0; *_Pnext = (*_Pnext)->_Mynextiter)
			(*_Pnext)->_Mycont = 0; // EXCEPTION HAPPENS HERE
		*(_Iterator_base **)&_Myfirstiter = 0;
		}
	}


This is my code:
for(int i=0; i < (int)getFileNamesString.size(); i++)
{
    getFNamesString = CIniFile::GetSection(getFileNamesString[i], applicationFname);
    for(int i=0; i < (int)getFNamesString.size(); i++)
        cout << "File Names -> " << getFNamesString[i].Key.c_str() << "=" << getFNamesString[i].Value << endl;
}
string FileName = getFNamesString[0].Value;     // UPDATER
string updateFName = getFNamesString[1].Value;  // UPDATE

printf("Creating Directory\n");
TCHAR szDirPath[] = TEXT("C:\\Test\\");
if (!CreateDirectory(szDirPath, NULL))
{
  printf("Could not create new directory.\n");
  getch();
  return -1;
}
else
    printf("Directory Created...\n\n");

strcat((char*)szDirPath, (const char*)updateFName.c_str());
char lpExistingFileName[BUF_SIZE];
char lpNewFileName[BUF_SIZE];
strcpy((char*)lpExistingFileName, (const char*)updateFName.c_str());
strcpy((char*)lpNewFileName ,(const char*)szDirPath);
if(CopyFile((LPCTSTR)lpExistingFileName,(LPCTSTR)lpNewFileName,FALSE))
    printf("File was copied successfully...\n");
else
    printf("File copy failed....\n");


bool SecRc = false;
vector<string> getSecNameString = CIniFile::GetSectionNames(FileName);
for(int i=0; i < (int)getSecNameString.size(); i++)
{
    vector<CIniFile::Record> getSecString = CIniFile::GetSection(getSecNameString[i], FileName);
    for(int i=0; i < (int)getSecString.size(); i++)
    {
        if (CIniFile::SetValue(getSecString[i].Key,getSecString[i].Value,getSecString[i].Section,updateFName))
            SecRc = true;
        else
            SecRc = false;
    }
}

if (SecRc)
    printf("\nSuccess...\nPress any key to continue....");
else
    printf("\nFailed...\nPress any key to continue....");
getch();
return 0;


Many thanx ( .. Confused | :confused: ..)

The only programmers that are better than C programmers are those who code in 1's and 0's..... Smile | :)

Smile | :) Programm3r

AnswerRe: Unhandled exception at .... Pin
Cedric Moonen20-Dec-06 20:16
Cedric Moonen20-Dec-06 20:16 
GeneralRe: Unhandled exception at .... Pin
Programm3r20-Dec-06 20:23
Programm3r20-Dec-06 20:23 
GeneralRe: Unhandled exception at .... Pin
kakan20-Dec-06 20:39
professionalkakan20-Dec-06 20:39 
GeneralRe: Unhandled exception at .... Pin
Programm3r20-Dec-06 20:48
Programm3r20-Dec-06 20:48 
AnswerRe: Unhandled exception at .... Pin
Programm3r20-Dec-06 20:51
Programm3r20-Dec-06 20:51 
GeneralRe: Unhandled exception at .... Pin
kakan20-Dec-06 21:07
professionalkakan20-Dec-06 21:07 
GeneralRe: Unhandled exception at .... Pin
Programm3r20-Dec-06 21:08
Programm3r20-Dec-06 21:08 
GeneralRe: Unhandled exception at .... Pin
kakan20-Dec-06 21:17
professionalkakan20-Dec-06 21:17 
Questionclass and functions Pin
cyn820-Dec-06 19:44
cyn820-Dec-06 19:44 
AnswerRe: class and functions Pin
nutkase20-Dec-06 20:24
nutkase20-Dec-06 20:24 
QuestionCopy constructor Pin
shadrach_india20-Dec-06 19:00
shadrach_india20-Dec-06 19:00 
AnswerRe: Copy constructor Pin
prasad_som20-Dec-06 19:09
prasad_som20-Dec-06 19:09 
QuestionDLL Initialization failed Pin
Parthiban20-Dec-06 17:49
Parthiban20-Dec-06 17:49 
AnswerRe: DLL Initialization failed Pin
shadrach_india20-Dec-06 18:44
shadrach_india20-Dec-06 18:44 
AnswerRe: DLL Initialization failed Pin
Stephen Hewitt20-Dec-06 19:00
Stephen Hewitt20-Dec-06 19:00 
GeneralRe: DLL Initialization failed Pin
Parthiban20-Dec-06 19:05
Parthiban20-Dec-06 19:05 
GeneralRe: DLL Initialization failed Pin
Stephen Hewitt20-Dec-06 19:19
Stephen Hewitt20-Dec-06 19: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.