🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: de.comp.lang.c++
2 messages
2 total messages Started by Schley Roland Tue, 23 Jan 1996 17:06
MSVC Big Problem with Borland dll
#1354
Author: Schley Roland
Date: Tue, 23 Jan 1996 17:06
67 lines
1340 bytes
I have created a DLL with Borland C++ 4.5 which does something 
like this:

<<<

#include<iostream.h>

class A
{
  public:
    void DoException();
};

void A :: DoException()
{
  try {
    throw ( long( 55 ) ); }

  catch ( long x ) {
    cout << "catch " << x << "\n"; }

}

///
// the exported function
///

extern "C" {
  void _export _cdecl Func1();
}


void _export _cdecl Func1()
{
  A a;
  a.DoException();
}

<<<

I have a little C++ test program that just calls the exported 
function Func1() which throws the exception:

<<<

extern "C" {

  void Func1(); }


void main()
{
  Func1();
}

<<<

When I compile the test program with Borland C++ 4.5 the 
program works as expected. 
But when I compile it with MSVC 4.0 the program crashes:
When the function Func1() is called in main() under the 
debugger, I receive an "unhandled exception in 
test.exe(KERNEL32.DLL): Access Violation."

Please help me!!

TIA Roland
Re: MSVC Big Problem with Borland dll
#1382
Author: Claus Faerber
Date: Wed, 24 Jan 1996 20:38
22 lines
1194 bytes
Schley Roland <schley@ids-scheer.de> schrieb zu
MSVC Big Problem with Borland dll
in Artikel <4e347t$3bi@pcc002.ids-scheer.de> vom 23.01.96:

> When I compile the test program with Borland C++ 4.5 the
> program works as expected.
> But when I compile it with MSVC 4.0 the program crashes:
> When the function Func1() is called in main() under the
> debugger, I receive an "unhandled exception in
> test.exe(KERNEL32.DLL): Access Violation."
>
> Please help me!!

The answer is simple: It's just that some compilers can handle  
exceptions passed from DLLs to calling applications and other  
compilers can't.

Claus

------------------------------------------------------------------------
Claus Andre Faerber - claus@faerber.muc.de - http://www.muc.de/~cfaerber
------------------------------------------------------------------------
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads