Re: IsBadCodePtr( (FARPROC)pointer_to_member_function)
From: Victor Bazarov (v.Abazarov_at_comAcast.net)
Date: 02/15/05
- Next message: AxessTerminated: "Re: Learning the win32 API"
- Previous message: valkyrie: "Re: About Windows clock"
- In reply to: Bill Davy: "IsBadCodePtr( (FARPROC)pointer_to_member_function)"
- Next in thread: Bill Davy: "Re: IsBadCodePtr( (FARPROC)pointer_to_member_function)"
- Reply: Bill Davy: "Re: IsBadCodePtr( (FARPROC)pointer_to_member_function)"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 14 Feb 2005 21:26:14 -0500
"Bill Davy" <Bill@SynectixLtd.com> wrote...
> Does not compile in VC6:
>
> error C2440: 'type cast' : cannot convert from 'HWErrors::HWErrorT
> (__thiscall SpinnerC::*const )(void)' to 'int (__stdcall *)(void)'
> There is no context in which this conversion is possible
>
> Is there a way round this?
Nope.
A non-static member function needs an instance of the class to be
called, that's why the conversion between a pointer to non-static
member and a pointer to a function does not exist.
> I'd just like, for completeness, to ensure that a call through a
> (non-virtual) member function pointer is not going to explode immediately.
Why? Do you manually load code into some arbitrary memory location?
- Next message: AxessTerminated: "Re: Learning the win32 API"
- Previous message: valkyrie: "Re: About Windows clock"
- In reply to: Bill Davy: "IsBadCodePtr( (FARPROC)pointer_to_member_function)"
- Next in thread: Bill Davy: "Re: IsBadCodePtr( (FARPROC)pointer_to_member_function)"
- Reply: Bill Davy: "Re: IsBadCodePtr( (FARPROC)pointer_to_member_function)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|