程序运行时出现0x00405cf6 处未处理的异常: 0xC0000005: 读取位置 0x00000000 时发生访问冲突我单步调试 跳到COMUTIL.H中的如下代码段里。inline _variant_t::_variant_t(IDispatch* pSrc, bool fAddRef) throw(){V_VT(this) = VT_DISPATCH;V_DISPATCH(this) = pSrc;
// Need the AddRef() as VariantClear() calls Release(), unless fAddRef// false indicates we're taking ownership//if (fAddRef) {V_DISPATCH(this)->AddRef();(跳到这一句)}}是什么错误,求指教!
// Need the AddRef() as VariantClear() calls Release(), unless fAddRef// false indicates we're taking ownership//if (fAddRef) {V_DISPATCH(this)->AddRef();(跳到这一句)}}是什么错误,求指教!
{
try
{
//if (m_pConnection==NULL)
// OnInitADOConn();
m_pRecordset.CreateInstance(__uuidof(Recordset));
m_pRecordset->Open(bstrSQL,(_variant_t)m_pConnection.GetInterfacePtr(),adOpenDynamic,adLockOptimistic,adCmdText);
}
catch(_com_error e)
{ AfxMessageBox(e.Description());
}
return m_pRecordset;
}