Posted on 2005-04-28
Last Modified: 2008-03-10
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 (pException != NULL)
                  pException->m_lOsError = ::GetLastError();
                  pException->m_cause =
I dont really understand how to use the debugger,so if any one could helpI'd be grateful
Question by:samroyc
    LVL 48

    Accepted Solution

    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.

    Author Comment

    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
    LVL 48

    Expert Comment

    CFile::Open is not your code. Find in the stack your code which calls this function.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Suggested Solutions

    A short article about problems I had with the new location API and permissions in Marshmallow
    Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now