home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.tools
- Path: sparky!uunet!utcsri!skule.ecf!torn!nott!emr1!jagrant
- From: jagrant@emr1.emr.ca (John Grant)
- Subject: Re: Exporting functions from Borland C++
- Message-ID: <1992Nov18.173447.721@emr1.emr.ca>
- Keywords: export
- Organization: Energy, Mines, and Resources, Ottawa
- References: <bsm.1.0@res.utc.com>
- Date: Wed, 18 Nov 1992 17:34:47 GMT
- Lines: 17
-
- In article <bsm.1.0@res.utc.com> bsm@res.utc.com (Brian S. McCarthy) writes:
- >
- >I've written a DOS application in Borland C++, which I now want to turn into
- >a DLL to link with a Visual Basic front end.
- >
- >How can I get Borland C++ to "export" a function from a C++ program? It's
- >no problem as long as I stick with C, but from C++ it won't export.
-
- C++ mangles the names, whereas C doesn't. See page 31-32 of
- Borland's "Programmer's Guide (3.1)" (blue/yellow/white book).
- Declare your function prototype as follows:
- extern "C" ... myfunc(...);
- This tells C++ not to mangle any references to this function.
- --
- John A. Grant jagrant@emr1.emr.ca
- Airborne Geophysics
- Geological Survey of Canada, Ottawa
-