How to convert a VARIANT buffer to a byte buffer?

Hello,

I have an ActiveX control that provides such method:
void GetCurrentImage(long theFormat, VARIANT * theBuffer, long * theBufferSize);

I want to get a byte image buffer from this function. That is, I am trying to do this:
long image_size;
VARIANT FrameBuf[1024*1024];
char ByteBuf[1024*1024];

// Get a pointer pCtrl to the ActiveX Control
pCtrl->GetCurrentImage(0, FrameBuf, &image_size);
// How to convert FrameBuf to ByteBuf?


I did some googling. But partly because VARIANT is a common word that confused Google, I can hardly find any useful solution to this. Can anyone give me some advice? Thank you very much.

Jason
closed account (S6k9GNh0)
http://en.wikipedia.org/wiki/Variant_type

Variant can be many things. For now you may assume that it is void. I suggest you look up how it's defined inside of the control.
Topic archived. No new replies allowed.