Compiler Not Seeing Overloaded Functions in Standard Class
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Compiler Not Seeing Overloaded Functions in Standard Class

  1. #1
    Join Date
    Jan 2004
    Location
    Near Portland, OR
    Posts
    222

    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:

    Code:
        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);
    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:

    '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.

    Bill

  2. #2
    Join Date
    Jan 2004
    Location
    Near Portland, OR
    Posts
    222

    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.

    Bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center