Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie to windows programming doesn't understand error

Status
Not open for further replies.

FinalBirdman

Programmer
Sep 21, 2002
9
0
0
US
I have a simple windows program that "should" have a standard window with a nice menu. I should be able to click on Help->about and see a nice little box. In order for this to work perfectly (a quick fix adds a small bug in which the about box doesn't dissapear after you click OK) I need to pass a windows procedure pointer to a function.

The proc has the form int FAR PASCAL myproc(unsigned int,unsigned int,unsigned int,long).

When I compile, I get the error "int (FAR PASCAL*)(unsigned int,unsigned int,unsigned int,long) cannot be converted to type int(FAR PASCAL*)()"

I belive that int(FAR PASCAL*)() means that the procedure being passed can have any parameters, so myproc should be fine. But it isn't.

I'm using Borland C++ 3.1. Any help is appreciated.
 
Well, I figured it out. I had to cast the function into a int (PASCAL far*)() like this:

ptr=(int(PASCAL far*)())myproc;

Just figured I'd let you know how it is done.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top