Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. handle exception in dynamically-linked DLL

handle exception in dynamically-linked DLL

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    John Oliver
    wrote on last edited by
    #1

    Hello, My Win32 app is calling a procedure stored inside a Dll, using LoadLibrary and GetProcAddress. Most of the time everything works okay. The dll is written in Fortran. The method being called opens a file, reads in data, performs calculations and outputs results in another file. Occasionally the calculations cause a Floating-Point Exception to occur. I don't have access to the Fortran src so I've being trying to catch the exception in the C++ calling code, using C++ exception handling but it doesn't catch. My questions are: 1) is this possible? (can an exception being thrown by a dll linked dynamically at run time be caught? - I could try creating an import library if that's possible.) 2) can anybody give me any clues? Thanks, John

    N 1 Reply Last reply
    0
    • J John Oliver

      Hello, My Win32 app is calling a procedure stored inside a Dll, using LoadLibrary and GetProcAddress. Most of the time everything works okay. The dll is written in Fortran. The method being called opens a file, reads in data, performs calculations and outputs results in another file. Occasionally the calculations cause a Floating-Point Exception to occur. I don't have access to the Fortran src so I've being trying to catch the exception in the C++ calling code, using C++ exception handling but it doesn't catch. My questions are: 1) is this possible? (can an exception being thrown by a dll linked dynamically at run time be caught? - I could try creating an import library if that's possible.) 2) can anybody give me any clues? Thanks, John

      N Offline
      N Offline
      Neville Franks
      wrote on last edited by
      #2

      I think you need to look at the Win32 Structured Exemption Handling (SEH). I'm sure you'll find articles here on SEH and of course on MSDN. Neville Franks, Author of ED for Windows. www.getsoft.com Make money with our new Affilate program

      J 1 Reply Last reply
      0
      • N Neville Franks

        I think you need to look at the Win32 Structured Exemption Handling (SEH). I'm sure you'll find articles here on SEH and of course on MSDN. Neville Franks, Author of ED for Windows. www.getsoft.com Make money with our new Affilate program

        J Offline
        J Offline
        John Oliver
        wrote on last edited by
        #3

        Thanks, Got the answer in Handling Exceptions, Part 17 in MSDN by using a 'Translator Function' to bind SEH to the more friendly C++ Exception handling mechanism. Work's perfectly! John

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups