I'm not sure what you are trying to do here, but it that line is broken in more ways that one. (And no, it has nothing to do with any casts to int *
. Where did int *
even come from? There's no int *
anywhere in your code.)
The last conversion in your convoluted conversion sequence is to CBaseFilter::AbstractProgVersion
type, which is a function pointer type. But then you attempt to initialize a void *
variable with it. Function pointer types are not implicitly convertible to void *
. That's your error.
If you want to force that conversion with an explicit cast, you can do
void* ProgVersion = (void *) &CBaseFilter::FilterVersionStatic;
What was the point of that extra conversion to CBaseFilter::AbstractProgVersion
?
But in any case, void *
is a data pointer type that should not be mixed with function pointer types. The language does not support conversions between data pointers and function pointers. The entire approach is hopelessly broken.
In fact, why on Earth are you even doing all these conversions? Why not just
int FilterVersion(CBaseFilter* pFilter)
{
return CBaseFilter::FilterVersionStatic(*pFilter);
}