Server-Client

I have a dialog based server-client that I created using MFC VC++6.0.I am using it to process and transfer files.,and
My application works once send the files over,but trying to do the same thing again crashes the sending application.
From the debug option,I get "Acess Violation error"
and from filecore.cpp
I have a break at
if (hFile == INVALID_HANDLE_VALUE)
      {
            if (pException != NULL)
            {
                  pException->m_lOsError = ::GetLastError();
                  pException->m_cause =
                        CFileException::OsErrorToException(pException->m_lOsError);
I dont really understand how to use the debugger,so if any one could helpI'd be grateful
samroycAsked:
Who is Participating?
 
AlexFMConnect With a Mentor Commented:
When porogram breaks on this line, select View - Debug Windows - Call Stack. In the Stack window you can see calling sequence, starting from your own code, to MFC code which crashed. Double-click on the Stack window line opens required program place in the text editor.
Find your own code which causes this error and try to understand why this happens. Possibly your code tries to work with file which is not opened yet or already closed.
0
 
samroycAuthor Commented:
Thank you for answering.I followed your advice calling stack gives -
>      MFC71.dll!CFile::Open(const char * lpszFileName=0x00001562, unsigned int nOpenFlags=0, CFileException * pException=0x7c1693cd)  Line 223      C++
       msvcr71.dll!malloc(unsigned int size=5474)  Line 54 + 0xf      C
I am unable to understand this ,and  have checked many times over that I close every file that I open
If you could help me decipher this a bit I'd be grateful
0
 
AlexFMCommented:
CFile::Open is not your code. Find in the stack your code which calls this function.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.