Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6814429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:41:17+00:00 2026-05-26T20:41:17+00:00

I remember all the hassle it used to be processing strings and ensuring that

  • 0

I remember all the hassle it used to be processing strings and ensuring that a newline was or wasn’t appended before EOF.

Now as my error references interop I am wondering if this is normal behaviour still or just an interop ‘enhancement’, here’s my error:

A first chance exception of type 'System.Runtime.InteropServices.SEHException' occurred in blah.exe
An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in blah.exe

Additional information: External component has thrown an exception.

Not terribly helpful. If I must terminate with a new line that’s cool but is the std library so far optimized that it can’t handle the odd EOF?

I think it should at least throw an exception that unwinds the stack to find a handler or terminate, but the stack is still deeply inside the std:: functions. Is this just a feature of the debug flags in VS?

EDIT

    ifstream is("MyfileorSummat.txt");
    string line;
    while (getline(is, line)) { //But when is reads last line @#&#@, it breaks, in the middle of a chain of std calls.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:41:17+00:00Added an answer on May 26, 2026 at 8:41 pm

    I have no idea how the SEHException is related, but is your input in the format of:

    std::istream& in;
    std::string line;
    while (std::getline(in, line)) {
        //stuff
    }
    

    That’s the safest method for reading in line by line I’ve ever come across.

    I think it should at least throw an exception that unwinds the stack to find a handler or terminate
    § 15.3 (From Feb 2011 C++ draft)

    If no matching handler is found, the function std::terminate() is called; whether or not the stack is unwound before this call to std::terminate() is implementation-defined (15.5.1).

    This means the debugger was right about to crash your entire program (probably without unwinding), but decided to be nice and break and show you what was happening first. You’ll have to step through the stack to see exactly why Windows decided to throw an SEHException. According to some random web crawling, an SEH can be fired by the standard library when you access unallocated memory, dereference NULL pointers, run out of memory, or other situations. You’ll also want to try to look at the members of the SEHException object, to see what the status and message are.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can never remember all the rules for implementing the IDisposable interface, so I
I remember VB5 (and all the horrors in it), but one thing I liked
Would this work on all platforms? i know windows does \r\n, and remember hearing
I've seen this in a webcast somewhere, but I can't remember where, and all
what is best IDE for auto-complete helper . because i can not remember all
I don't even remember how, but somehow I managed to make all of my
Dear all, I am working with Databases and I am confusing with their connection-strings
I vaguely remember that I need to join the two weird tables to get
When GDI+ came out, I remember all the brouhaha about how it was the
Are all modern browsers implementing a remember password feature? Or do I have to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.