Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!maverick.ksu.ksu.edu!iowasp.physics.uiowa.edu!ns-mx!ccad.uiowa.edu!cadsi From: cadsi@ccad.uiowa.edu (CADSI) Newsgroups: comp.windows.ms.programmer Subject: Re: Use of MakeProcInstance with BC++, Question. Message-ID: <1991Apr24.060414.24712@ccad.uiowa.edu> Date: 24 Apr 91 06:04:14 GMT References: <1991Apr24.003535.26852@milton.u.washington.edu> Organization: CAD-Research, U. of Iowa, Iowa City, Iowa Lines: 31 From article <1991Apr24.003535.26852@milton.u.washington.edu>, by water@milton.u.washington.edu (Hong Li): > Hi, I am migrating one program from MS-C to BC++. I encounted a problem and > ran out of gas in searching the menu. Could someone help me? Thanks a lot. > > Problem: > I declared a user function as > > BOOL FAR PASCAL MyProc(..omitted) > { > ... > } > > Now I want to make a call > > lpMyProc = MakeProcInstance(MyProc, hInstance); > > With MS-C 5.1, it works fine. But BC++ complained an error: type mismatch in > MakeProcInstance. I have tried casting, but failed. > > What can I do? Has anyone encounted similar problem? lpMyProc = MakeProcInstance((FARPROC)MyProc, hInstance); This works, I do it all over. The other thing to do is compile things without C++ (which performs name-mangling which is causing your problem). |----------------------------------------------------------------------------| |Tom Hite | The views expressed by me | |Manager, Product development | are mine, not necessarily | |CADSI (Computer Aided Design Software Inc. | the views of CADSI. | |----------------------------------------------------------------------------|