Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!aero-c!gumby.dsd.trw.com!deneva!wiley!rich From: rich@wiley.uucp (Rich Messenger) Newsgroups: comp.windows.ms.programmer Subject: Re: Solution to BC++ Petzold problem, and mild bug report Keywords: n Message-ID: <282A109B.606E@wilbur.coyote.trw.com> Date: 10 May 91 03:16:42 GMT References: <2828D392.40DD@wilbur.coyote.trw.com> <1991May9.151819.3190@mnemosyne.cs.du.edu> Sender: news@wilbur.coyote.trw.com (News Software) Organization: TRW Inc., Redondo Beach, CA Lines: 28 In article <1991May9.151819.3190@mnemosyne.cs.du.edu> cjones@isis.UUCP (Charles J. Jones) writes: >In article <2828D392.40DD@wilbur.coyote.trw.com> rich@wiley.uucp (Rich Messenger) writes: >>(1) When you are compiling as C++, you *cannot* use the EXPORTS section >>in the .DEF file, since the name is mangled by C++ before the linker >>ever sees it. This tidbit is not mentioned in the documentation. > >Sure you can. But you have to change the function definition re: > >long FAR PASCAL WndProc(HWND hwnd ... > >becomes > >extern "C" long FAR PASCAL WndProc(HWND hwnd ... > >the same as always in C++ when you want ot prohibit the compiler >from mangling the name. > >Charles Correct. The purpose of my posting was to warn the unwary that some special care must be taken when using C++, even though Borland does not alert you to the fact. If you are aware of the name mangling problem, you can choose several "fixes" which all work. Thank you for adding another alternative to those I mentioned. _ __ ' ) ) / ... Rich Messenger /--' o _. /_ rich@wilbur.coyote.trw.com / \_(_(__/ /_ {uunet,cit-vax,trwrb}!wiley!rich