🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: de.comp.lang.c++
Article #1354

MSVC Big Problem with Borland dll

#1354
From: 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
Technical Details
Message-ID: <4e347t$3bi@pcc002.ids-scheer.de>
Path: arc1-ca.pugleaf.net!pcc002.ids-scheer.de!news

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!pcc002.ids-scheer.de!news
From: schley@ids-scheer.de (Schley Roland)
Newsgroups: de.comp.lang.c++
Subject: MSVC Big Problem with Borland dll
Date: Tue, 23 Jan 1996 17:06:32 GMT
Organization: IDS Prof. Scheer GmbH
Message-ID: <4e347t$3bi@pcc002.ids-scheer.de>
NNTP-Posting-Host: pse107.ids-scheer.de
X-Newsreader: Forte Agent .99.82