home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / mswindo / programm / tools / 1457 < prev    next >
Encoding:
Text File  |  1992-11-18  |  1.1 KB  |  29 lines

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