Thread: Errors in MFC apps

  1. #1
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121

    Errors in MFC apps

    When I make an MFC application and something goes wrong during run time the app will often throw up an error that I didnt write, and doesnt appear anywhere in the source or string tables. There is one 'error' that I would like to remove completely. I am making a frontend for a (huge) database, but on running the program I get 'too many fields defined' error.

    I would like to change the maximum limit or remove this error completely, as susrely the amount of maximum fields should depend on free resources etc, and is not constant.

  2. #2
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121
    Through further research I've found this is an error specific to access databases with more than 255 fields. Still if anyone knows how to remove this limit I'd appreciate it.

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    223

    dao errors

    trap the error and look at the help files indicated for the error


    Code:
    try{
    
       ....dao operations here
    
    }
    catch( CDaoException* e )
    {
    
        int iErrorCount = e->GetErrorCount();
        CString sMsg;
        CString sFullMsg;
        for( int i = 0; i < iErrorCount; i++
        {
             e->GetErrorInfo( i );
             sMsg.Format("Error code %d\nSource %s\nDescription %s\nHelpFile %s\nHelp Context %d",
              e->m_pErrorInfo->m_lErrorCode, e->m_pErrorInfo->m_strSource, e->m_pErrorCode->m_strDescription, ...m_strHelpFile, m_lHelpContext);
             sFullMsg += sMsg;
             sFullMsg += "\n";
         }
    
         MessageBox( sFullMsg );
         
    }
    Usually the associated help files jeterr...hlp have some pretty direct causes and I am able to fix my program from there...
    zMan

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Windows, MFC, .NET, C++ ???
    By alpha in forum Windows Programming
    Replies: 8
    Last Post: 08-07-2006, 02:31 PM
  2. MFC support in ATL project
    By Arkanos in forum Windows Programming
    Replies: 2
    Last Post: 01-29-2006, 05:15 PM
  3. Windows Forms and/or MFC [But definately not win32!] questions
    By Robert_Sitter in forum Windows Programming
    Replies: 2
    Last Post: 12-03-2005, 09:28 PM
  4. MFC in an empty project
    By cunnus88 in forum Windows Programming
    Replies: 0
    Last Post: 10-09-2005, 09:19 AM
  5. MFC Perils
    By cboard_member in forum C++ Programming
    Replies: 4
    Last Post: 07-27-2005, 05:11 PM