1

For oleautomation type, there are VT_xxx types:

   SAFEARRAYBOUND rgsabound[1];
   rgsabound[0].lLbound = 0;
   rgsabound[0].cElements = m_cPoints;
   psa = SafeArrayCreate(VT_VARIANT, 1, rgsabound);

For custom types, there is IRecordInfo:

SafeArrayCreateEx(VT_RECORD, 1, &rgbounds, pRecInfo);

But what is the right type for windows' system type such as POINT?

Jichao
  • 40,341
  • 47
  • 125
  • 198

1 Answers1

2

POINT is not an OLE-compatible type. VT_RECORD only works for custom types that are defined in a TypeLibrary. You will have to either:

  1. create a TypeLibrary that replicates POINT and then retrieve IRecordInfo from the TypeLibrary

  2. create a safearray of bytes (VT_UI1) instead and then copy the raw POINT bytes into it. The receiver will then have to read the bytes according.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770