Is it possible to dynamically type cast a pointer to some object type?
I want a function something like this...
int ReturnSomething(LPVOID myPointer, SOME_TYPE_HERE) {
int intReturn;
intReturn = ((SOME_TYPE_HERE *)myPointer)->Something;
return(intReturn);
}
The SOME_TYPE_HERE part should be dynamic so that I can pass in one or more types. All the types will be structures and will contain a "Something" element. I have seen things mentioned about dynamic type casting, but I don't know if that's what I want to solve this problem.
Thanks for your help.
Start Free Trial