Search code examples
windowswinapicomnaming-conventionsnaming

Meaning of "ETC" in FORMATETC and "TYMED"?


I feel uncomfortable when I need to use names in the code that I don't fully understand. Currently I want to implement clipboard functionality with OLE and I've encountered a bit confusing FORMATETC and TYMED. Sadly, I can't find explanation on Microsoft Docs. What is "ETC"? Is that "et cetera"? If so, it seems to be a bad name. And TYMED? "MED" most likely means "medium", but what is "TY"?


Solution

  • It would appear, indeed, that the "etc" part of FORMATETC stands for et cetera (Latin for "and so on," or "and the rest"), as the FORMATETC structure contains a member specifying the format type along with members specifying 'other' information:

    typedef struct tagFORMATETC {
      CLIPFORMAT     cfFormat;
      DVTARGETDEVICE *ptd;
      DWORD          dwAspect;
      LONG           lindex;
      DWORD          tymed;
    } FORMATETC, *LPFORMATETC;
    

    The TYMED enumeration values do (also as you have postulated) represent different TYpes of storage MEDia.