[comp.sys.amiga] Setfunction help needed.

8642420@wwu.edu (eric cosky) (03/17/89)

	Hi. I'm having a problem using SetFunction. I'm trying to modify
	the OpenScreen function so that it will always open an interlace
	screen with a height of 400. Anyways, I've been getting a ptr/int
	error no matter what I try to do. Here's the code fragment that
	does the work...
	


extern long SetFunction();
struct Screen *(*OldOpenScreen)();
extern struct Screen *MyOpenScreen();

main()
{
	[stuff deleted]	
		OldOpenScreen = SetFunction(IntuitionBase,-198,MyOpenScreen);
		[Wait for a break from other task to exit]
		SetFunction(IntuitionBase,-198,OldOpenScreen); */
	[more stuff deleted]
}


	Here's what I'd like to have the OpenScreen point to:
	

struct Screen *MyOpenScreen(ns)
struct NewScreen *ns;
{
	struct Screen *s;
	
	/* set the viewmodes and height values accordingly. */
	ns->ViewModes |= LACE;
	ns->Height = 400;

	/* call the original function */
	s = OldOpenScreen(ns);
	
	return(s);
}
	

	Could someone please post or email me an effective modification to
	this code? Frustration is really starting to set in..
	
	Thanks for any help.
	

-eric cosky
InterNet:	<8642420@wwu.edu>
Phone:		206-733-1331