开发者

What's the difference between TYPE_E_BUFFERTOOSMALL and DISP_E_BUFFERTOOSMALL HRESULT values?

Reviewing WinError.h I noticed there're two HRESULT values:

#define DISP_E_BUFFERTOOSMALL _HRESULT_TYPEDEF_(0x80020013L)
#define TYPE_E_BUFFERT开发者_StackOverflow社区OOSMALL _HRESULT_TYPEDEF_(0x80028016L)

both are claimed to resolve to "buffer too small" text and they both have the same "facility" part and only differ in the "code" part.

What's the difference between these two values?


DISP_E_BUFFERTOOSMALL is intended for general use in IDispatch interfaces.

I believe that TYPE_E_* errors are intended for type conversion error. TYPE_E_BUFFERTOOSMALL appears to be for problems with converting VARIANTs or PROPVARIANTs. I looked around and found it used in the context of "property bags" (which is a serializable collection); for example, see this.

In the context of your other question, DISP_E_BUFFERTOOSMALL is a better fit.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜