必须在任何数据库值之前设置_variant_t的vt数据类型吗? [英] must the vt data type of a _variant_t be set before any database value is to it?

查看:95
本文介绍了必须在任何数据库值之前设置_variant_t的vt数据类型吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否必须在任何数据库值之前设置_variant_t的vt数据类型?我在msdn示例中注意到我看到vt数据类型在使用之前已设置,例如到VT_INTEGER.Is那个规则。我真的不需要那个。我希望这不是规则。谢谢你的回复。

must the vt datatype of a _variant_t be set before any database value is to it? I noticd in the msdn examples that I saw that the vt data type was set before use e.g. to VT_INTEGER.Is that the rule.I really don't need that.I hope that is not the rule.Thanks for your response.

推荐答案

_variant_t 重载了构造函数和重载=运算符,它们会自动将 vt 成员设置为正确的值。

因此,除非要覆盖默认行为,否则永远不需要显式设置它。
_variant_t has overloaded constructors and overloaded = operators that will automatically set the vt member to the correct value.
So you never need to set it explicitly unless you want to override the default behavior.


这篇关于必须在任何数据库值之前设置_variant_t的vt数据类型吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆