在vc中使用ado打开数据库的时候,用到了这样的代码:_ConnectionPtr m_pConnection;
_RecordsetPtr m_pRecordset; m_pConnection.CreateInstance(_uuidof(Connection));
m_pRecordset.CreateInstance(_uuidof(Recordset));m_pConnection->Open("xxxx" ,"","",0);
m_pRecordset->Open("xx", m_pConnection.GetInterfacePtr () ,adOpenDynamic,adLockOptimistic, 1); 在 m_pRecordset->Open 一句中使用到了 m_pConnection.GetInterfacePtr()
可是 m_pConnection 明明定义成一个类对象,应该使用 -> 才对,为什么使用了 . 呢?
_RecordsetPtr m_pRecordset; m_pConnection.CreateInstance(_uuidof(Connection));
m_pRecordset.CreateInstance(_uuidof(Recordset));m_pConnection->Open("xxxx" ,"","",0);
m_pRecordset->Open("xx", m_pConnection.GetInterfacePtr () ,adOpenDynamic,adLockOptimistic, 1); 在 m_pRecordset->Open 一句中使用到了 m_pConnection.GetInterfacePtr()
可是 m_pConnection 明明定义成一个类对象,应该使用 -> 才对,为什么使用了 . 呢?
解决方案 »
- 数据库查询结果记录集序列化
- vc++一个工程里面为什么不能有两个main函数呢
- DoModal()一个很有意思的问题 在线等
- 在PreTranslateMessage中截获不了SetWindowText所产生的WM_SETTEXT?
- 24bit转成16bit问题
- 《《《《《哪位有与MSN通信的简单的示例代码??
- 急件!!!!!!!!!锁定这个WIN到底是怎么会事呀,????????????????
- 图形填充问题
- vc的MDI程序,当打开子窗口较多时,部分窗口不能正常刷新
- 作为一名Vc++菜鸟(初学者),在学完语言之后,该学哪些?
- 怎样区分左、右Ctrl、Alt、Shift键按下?
- 知道一个进程ID,怎样通过进程ID得到线程ID?
例
CPoint point;
CPoint ptr;
ptr = &point;
则
point.x 与 ptr->x 一样