Can't derive class from CRecordSet 
Author Message
 Can't derive class from CRecordSet

I am using VC++ v6.0's ClassWizard to create a class derived from
CRecordSet.  

I enter the following:

Class Type:     MFC
Class Name:   TaskRecordSet
Base Class:    CRecordSet
DataSource: ODBC (MS-Access 97)
RecordSet Type: DynaSet
Select the database
Select the tables

When I hit OK I get the message "The file names
(E:\C++\Tasker\TaskRecordSet.h, E:\C++\Tasker\TaskRecordSet.cpp) for
the class TaskRecordSet do not exist or are invalid file names."

Although the files don't exist, I've change the class name.  Even
tried creating the files.  When I do, the wizard tacks a 1 on the end
of the new file name.

Any ideas?

Thanks,

Martin



Wed, 30 May 2001 03:00:00 GMT  
 Can't derive class from CRecordSet
Actually for the class name, instead of TaskRecordSet, use CTaskRecordSet
and let me know if it works.

=-chris conner

Quote:

>I am using VC++ v6.0's ClassWizard to create a class derived from
>CRecordSet.

>I enter the following:

>Class Type:     MFC
>Class Name:   TaskRecordSet
>Base Class:    CRecordSet
>DataSource: ODBC (MS-Access 97)
>RecordSet Type: DynaSet
>Select the database
>Select the tables

>When I hit OK I get the message "The file names
>(E:\C++\Tasker\TaskRecordSet.h, E:\C++\Tasker\TaskRecordSet.cpp) for
>the class TaskRecordSet do not exist or are invalid file names."

>Although the files don't exist, I've change the class name.  Even
>tried creating the files.  When I do, the wizard tacks a 1 on the end
>of the new file name.

>Any ideas?

>Thanks,

>Martin



Sun, 03 Jun 2001 03:00:00 GMT  
 Can't derive class from CRecordSet
I would try creating a new blank project and see if you can create
a CRecordset class in the same manner.  Sometimes the wizard
can get confused with the information in the .clw file.  I've manually
edited the .clw file in the past to fix this type of problem.   Completely
close the project and make a backup of the .clw file for your project.
Next open the .clw file in notepad and remove all sections pertaining
to TaskRecordSet (there will be 2 sections as below):

[CLS:TaskRecordSet]
Type=0
HeaderFile=TaskRecordSet.h
etc....

[DB:TaskRecordSet]
DB=1
DBType=ODBC
etc...

Also update the [General Info] section to remove all references to the
TaskRecordset class -- here is an example:

[General Info]
Version=1
LastClass=TaskRecordSet  // REMOVE!
LastTemplate=CRecordset
NewFileInclude1=#include "stdafx.h"
NewFileInclude2=#include "Tasker.h"

ClassCount=5            // MODIFY to 4 (5-1)
Class1=CTaskerApp
Class2=CTaskerDlg
Class3=CAboutDlg

ResourceCount=3
Resource1=IDD_ABOUTBOX
Resource2=IDR_MAINFRAME
Resource3=IDD_TASKER_DIALOG
Class5=TaskRecordSet  // REMOVE!

Remove the sections and save the .clw file.  Re-open the project and
try to re-insert the class using the Wizard.

Can't make any promises here.  Sometimes it is easier to create a
new project from scratch and import your existing code if your project
is not too extensive yet.

Matt


Quote:
>Actually for the class name, instead of TaskRecordSet, use CTaskRecordSet
>and let me know if it works.

>=-chris conner


>>I am using VC++ v6.0's ClassWizard to create a class derived from
>>CRecordSet.

>>I enter the following:

>>Class Type:     MFC
>>Class Name:   TaskRecordSet
>>Base Class:    CRecordSet
>>DataSource: ODBC (MS-Access 97)
>>RecordSet Type: DynaSet
>>Select the database
>>Select the tables

>>When I hit OK I get the message "The file names
>>(E:\C++\Tasker\TaskRecordSet.h, E:\C++\Tasker\TaskRecordSet.cpp) for
>>the class TaskRecordSet do not exist or are invalid file names."

>>Although the files don't exist, I've change the class name.  Even
>>tried creating the files.  When I do, the wizard tacks a 1 on the end
>>of the new file name.

>>Any ideas?

>>Thanks,

>>Martin



Thu, 14 Jun 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Can't create new record using CRecordset derived class

2. My CRecordset derived class doesn't work in Release mode

3. Can't derive class from CRecordSet

4. Class Wizard won't let me derive a class from my class

5. cann't get runtime class for CDateTimeCtrl/CMonthCalCtrl derived class

6. NTDLL.DLL Access Violation in CRecordset-derived class?

7. Derived CRecordset class questions

8. Derived CRecordset or standalone CODBC class ?

9. Enumerated field access thru CRecordset-derived class

10. Classes derived from CRecordset and CDaoRecordset

11. Derived Class off CRecordSet

12. Problem deriving a class from CRecordSet

 

 
Powered by phpBB® Forum Software