Date: Fri, 20 Jun 1997 12:57:20 -0700 From: Bill Currie Subject: Re: help on VESA 2.0 PMode interface and pointers to functions (in C++)... To: Jeff Weeks Cc: djgpp AT delorie DOT com Reply-to: billc AT blackmagic DOT tait DOT co DOT nz Message-id: <33AAE0A0.563B@blackmagic.tait.co.nz> Organization: Tait Electronics NZ MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit References: <33A988FE DOT 38A29093 AT execulink DOT com> Precedence: bulk Jeff Weeks wrote: > I have three pointers to functions and a structure for the protected > mode interface: > VesaProtected *pm_info; > void (*_pm_vesa_switcher)(); > void (*_pm_vesa_scroller)(); > void (*_pm_vesa_pallete)(); > ANSI C++ forbids pointer conversion from void * > > Atleast I think that's it. Now, I'm pretty sure these lines work fine Pretty spot on. > in C. It's in C++ where they have trouble, so what's wrong? What has > changed in C++ to make these non ANSI? And how can I fix it? In C++, anything can be assigned to a void* but void* can not be assigned to anything at all without a cast. Just change your code to (eg): _pm_vesa_pallete = (void (*)())((char *)pm_info + pm_info->setPalette); BTW, unless you chopped out the parameters for bandwidth reasons, you'll have to put them in otherwise the compiler will treat the functions as void foo(void). Sorry, can't help with the other question. Bill -- Leave others their otherness.