The method adding an element is :
HRESULT Add(_In_ const T& t, _In_ BOOL bCopy = TRUE) // 0x00 as zero for t
that is, your argument is expected to be of type const BYTE&
. There is however another Add
method which can accept your zero argument:
HRESULT Add(_In_ const SAFEARRAY *psaSrc) // 0x00 as NULL for pasSrc
Hence the ambiguity and you are expected to resolve it by casting your argument appropriately:
CComSafeArray<BYTE> arr;
arr.Add((const BYTE&) 0x00);