Get data from VARIANT



Hi,

I'm using a COM ActiveX inside my application written in C#.
I have no source of the ActiveX, just a small snippet.
There's an event in the ActiveX that pass some data using a VARIANT
structure as defined in the following snippet:

struct ImageInfo {
PBYTE Y;
PBYTE U;
PBYTE V;
}

ImageInfo* info = …;

VARIANT V;
V.vt = VT_BYREF | VT_UI1
V.pbVal = Info->Y.

Visual Studio translate the event signature with a 'ref object' parameter
for the VARIANT.
I need to reach the pbVal member and marshal it to get an array of bytes.
How should I do?

Thank you in advance

Marco
.



Relevant Pages

  • Re: ActiveX VARIANT type question
    ... C++ library uses an ActiveX control to pass data to VB. ... passed as a variant. ... I have found however, than VB6 is not threadsafe, so I cannot simply use callbacks from my C++ code to the VB frontend. ... I serialize a data structure into a byte stream in my multithreaded C++ library ...
    (microsoft.public.vb.com)
  • Bloomberg ActiveX
    ... I tried other ActiveX from Bloomberg that works. ... Subscribe = Variant Subscribe(handle, Variant, ... int32, Variant, Variant) ... GetHistoricalData = Variant GetHistoricalData ...
    (comp.soft-sys.matlab)
  • byte[] from C# to MFC ActiveX - VARIANT is messed up
    ... The VARIANT I am getting on the other side (in ActiveX) is garbage. ... Has anybody encountered such problems when passing data from C# to MFC ... VARIANT_BOOL CSwitchboardStorageCtrl::EnqueueBytes(VARIANT bytesArray) ...
    (microsoft.public.dotnet.framework.interop)
  • How To call activex method with a Variant
    ... But this requires using activex controls ... I have an activeX method: ... The activeX variant 'vBuffer' was a SAFEARRAY of bytes. ...
    (microsoft.public.dotnet.framework.interop)

Loading