Using MFC classes inside ATL Project
I have created an ATL Project with all default options using VC++ 2008.
I have added Simple ATL object (interface IDemo) and some interface moethos inside the simple object.
I want to use MF开发者_如何转开发C classes (e.g. CDatabase, CRecordset and lots more) inside my ATL project.
How can I achieve this?
Thanks.
Nearly the only reasonable answer is "don't do that". ATL has OLE DB consumer templates of its own. If you want data access from an ATL project, those are the ones to use. If you're going to use MFC, make it an MFC project and be done with it.
One of the major arguments aginst MFC is that it's difficult (borders in impossible in some cases) to separate individual pieces of it out from the rest and use them in isolation.
精彩评论