December 30th, 2008, 05:49 AM
Compiler Not Seeing Overloaded Functions in Standard Class
I'm currently developing a Dao project with VC 2005 and I've run into an odd problem. For the open function of CDaoRecordSet, there are three versions defined:
This is how it's defined in afxdao.h. I am trying to use the third version of this function. I have a CDaoRecordSet created and opened. When I compile, I get the error:
virtual void Open(int nOpenType = AFX_DAO_USE_DEFAULT_TYPE,
LPCTSTR lpszSQL = NULL, int nOptions = 0);
virtual void Open(CDaoQueryDef* pQueryDef,
int nOpenType = dbOpenDynaset, int nOptions = 0);
virtual void Open(CDaoTableDef* pTableDef,
int nOpenType = dbOpenTable, int nOptions = 0);
'CBKTrackerSet::Open' : cannot convert parameter 1 from 'CDaoTableDef *__w64 ' to 'int'
It appears that the compiler is only seeing the first version of this function and doesn't recognize the other two. I recall running into this same problem somewhere else, but it was easy to convert to the other version in that case, so I just went with that and kept going.
Anybody know what's going on? I've never seen this except with the Dao library in VC 2005.
December 30th, 2008, 05:59 AM
Re: Compiler Not Seeing Overloaded Functions in Standard Class
I think I found the problem. I had included Open in my derived class and it inserted the first version and not the one I needed. I changed the inserted function to the version I wanted and it compiles OK.
I now have a run time error, but I think it's not directly related.
Click Here to Expand Forum to Full Width