Hello
This might be simple to answer, but please bear with me. My image processing program needs to use various types ie short, long, float. I get a pointer (*pMod) to a pixel which is used to modify the pixel values.
Code:
hr = SafeArrayPtrOfIndex(pData, ij, (void **)&pMod);
if (FAILED(hr)) AfxMessageBox("nope");
(*pMod) = dVal;
However the pointer clearly needs to be of the same type as the Safearray, therefore I want to CHANGE THE VARIABLE TYPE, KEEPING THE POINTER NAME CONSTANT for use with different image types. I've tried using unions, but unless mistaken I cannot change the type without using a switch. IS there any other way?
Thanks for your attention.
Will