STDMETHODIMP CNewMail::put_SendAsHTML(BOOL newVal)
{
// TODO: Add your implementation code here
SendAsHTML=newVal;
return S_OK;
}
当我从数据库中提取一个布尔值时,发现SendAsHTML总是FALSE
例如:cc.SendAsHTML=rs("AUTH")
但如果cc.SendAsHTML=true 就不会有问题。似乎cc.SendAsHTML需要一个长整形的值。怎么办才能使它接受布尔值?
{
// TODO: Add your implementation code here
SendAsHTML=newVal;
return S_OK;
}
当我从数据库中提取一个布尔值时,发现SendAsHTML总是FALSE
例如:cc.SendAsHTML=rs("AUTH")
但如果cc.SendAsHTML=true 就不会有问题。似乎cc.SendAsHTML需要一个长整形的值。怎么办才能使它接受布尔值?
u should
CComVariant vtAuth = rs("AUTH");
if (vtAuth.vt != VT_BOOL)
error code herecc.SendAsHTML = (vtAuth.boolVal == VT_TRUE)!TRUE:FALSE;in VB, u can write the similar code to make check before use.or u can define put_SendAsHTML as VARIANT_BOOL to simplified the last statement.