🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #2274

Re: Use of MakeProcInstance with BC++, Question.

#2274
From: CADSI
Date: Wed, 24 Apr 1991 06:04
31 lines
1750 bytes
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.       |
|----------------------------------------------------------------------------|
Technical Details
Message-ID: <1991Apr24.060414.24712@ccad.uiowa.edu>
Path: arc1-ca.pugleaf.net!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
References: <1991Apr24.003535.26852@milton.u.washington.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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