fatal exception 0E

This is a discussion on fatal exception 0E within the Windows Programming forums, part of the Platform Specific Boards category; I am developing a software for data acquitition using vc++6.0. During the course of the program I am getting a ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    17

    fatal exception 0E

    I am developing a software for data acquitition using vc++6.0.

    During the course of the program I am getting a fatal error OE. On investigating the fatal error 0E, I realised that this is a page fault.

    I am getting this error while I am setting a text in an edit window of a dialog box.If I comment the code line in which I have used SetWindowText , The fatal error is eliminated. I am not able to reason out the problem. I have also used _out and _inp for addressing the data acq. card.

    I am writting the code below.

    //First get the text from the edit box.m_filename1 is a member
    //variable of edit box

    CString strin1;
    m_filename1.GetWindowText(strin1);
    char name1[50];
    strcpy(name1,LPCTSTR(strin1));

    // some outport & inport commands for card interfacing

    _outp(portA+4,nlow);
    _outp(portA+5, nhi);
    dtl = _inp(portA);
    dth = _inp(portA+1);

    //Opening a file of name fetched by the text box and saving
    //some data in it and then closing the file.
    ofstream file (name1);
    file<<"OUTPUT VOLTAGE"<<" "<<"VOLTAGE(V1) ";
    file<<"VOLTAGE(V2) "<<"RATIO(V1/V2) "<<"\n"; file<<temp;
    file<<"\n";
    file.close();

    // outporting certain values again before exit
    n = 0;
    _outp(portA+4,n);
    _outp(portA+5, n);

    // Changing the name of the file to be used for storing the next
    //run by incrementing the number and adding it to the filename
    //string
    incr = incr+1;
    strcpy(name1,name);
    char addon[10];
    itoa(incr,addon,10);
    strcat(name1,addon);

    // (name1) now contains the string to be used as the next file
    //name. BELOW IS THE LINE THAT IS CREATING THAT FATAL
    //ERROR. IF I COMMEMNT THIS LINE , THE PROBLEM IS SOLVED
    //BUT HOW WILL I THEN WRITE THE NAME OF THE NEXT FILE IN
    //THE EDIT BOX.
    m_filename1.SetWindowText(name1);

    I am stuck in the above problem.

    How to remove the exception invalid page fault or fatal exception 0E.

    Help me if you can.

    juhi

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    17

    help in vc++6.0

    I am developing a software for data acquitition using vc++6.0.

    During the course of the program I am getting a fatal error OE. On investigating the fatal error 0E, I realised that this is a page fault.

    I am getting this error while I am setting a text in an edit window of a dialog box.If I comment the code line in which I have used SetWindowText , The fatal error is eliminated. I am not able to reason out the problem. I have also used _out and _inp for addressing the data acq. card.

    BELOW IS THE LINE THAT IS CREATING THAT FATAL
    //ERROR. IF I COMMEMNT THIS LINE , THE PROBLEM IS SOLVED
    //BUT HOW WILL I THEN WRITE THE NAME OF THE NEXT FILE IN
    //THE EDIT BOX.
    m_filename1.SetWindowText(name1);

    I am stuck in the above problem.

    How to remove the exception invalid page fault or fatal exception 0E.

    Help me if you can.

    juhi

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    I have merged your two messages in this forum and deleted the crosspost on C++. Crossposting and multiple posting is against the board rules.

    As to your problem, I can't see enough code to be sure but, you read the existing filename from the edit box, then add a number to the end of it, making it larger each time. Should you not be replacing the number on the end of the filename rather than concaternating it? If you run through this code several times, you will eventually blow up your arrays.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    17
    I am not adding a no every time rather I am changing the last number . ie. The first filename will be testing1, second will be testing2(not testing12) third will be testing3(and not testing123).

    This is because after everu run string in name1 is changed to the original string name(by the statement strcpy(name1,name) ) and name is a constant string taken fromthe previous window.

    juhi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Exception handling in a large project
    By EVOEx in forum C++ Programming
    Replies: 7
    Last Post: 01-25-2009, 06:33 AM
  2. exception handling
    By coletek in forum C++ Programming
    Replies: 2
    Last Post: 01-12-2009, 04:28 PM
  3. Signal and exception handling
    By nts in forum C++ Programming
    Replies: 23
    Last Post: 11-15-2007, 01:36 PM
  4. fatal exception 0e
    By juhigarg in forum Windows Programming
    Replies: 0
    Last Post: 12-03-2001, 04:41 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21