Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / November 2004

Tip: Looking for answers? Try searching our database.

"Add Class" problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marius Matioc - 30 Oct 2003 04:52 GMT
When trying to do an "Add Class" and selecting "MFC class", I get
the message "MFC classes can only be added to MFC projects".
My project is an MFC project and has many MFC based classes inside.
What makes Visual Studio think that a project is an "MFC project" or
not?
I checked for any properties that could be set in the project properties
but could not find anything that looked relevant.

Thanks,
Marius Matioc
Gary Chang [MSFT] - 30 Oct 2003 10:51 GMT
Hi Marius,

Thanks for you posting in this group!

What's you described in the post is really weird to me,  I even cannot find
any possible reason that could cause such situation.

Have you tried to add MFC class to another MFC project? If the another
works well, I think  the problematic project configuration data maybe
corrupted by accidence.

Best Regards

Gary Chang
Microsoft Online Partner Support
Get Secure! ? www.microsoft.com/security
This posting is provided "AS IS" with no warranties,and confers no rights.
--------------------
| Reply-To: "Marius Matioc" <pentalogix@pentalogix.com>
| From: "Marius Matioc" <pentalogix@pentalogix.com>
[quoted text clipped - 8 lines]
| Newsgroups: microsoft.public.vsnet.ide
| NNTP-Posting-Host: adsl-66-124-225-208.dsl.snfc21.pacbell.net
66.124.225.208
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.vsnet.ide:8927
[quoted text clipped - 10 lines]
| Thanks,
| Marius Matioc
Marius Matioc - 31 Oct 2003 00:51 GMT
Hello and thanks for answering,

No, I have not tried to add to another project.
Are you suggesting that I make a new one and try it there?

At any rate, this project is a really old one (more than 7 years
old), so I have been upgrading it with all the new versions of
Visual Studio. I am using VS2003 right now.
Everything else works, the project builds OK etc.
Could you please find out what the error message means
("MFC classes can only be added to MFC projects")?

It must be looking somewhere in the project to determine that
it is (or not) an MFC based project. If I know where it is I
can maybe change it (through setup or manually editing the .vcproj
file).

Any additional info is appreciated.

Thanks,
Marius

> Hi Marius,
>
[quoted text clipped - 13 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties,and confers no rights.
Marius Matioc - 31 Oct 2003 02:24 GMT
Hello,

One more important piece of information:
The solution that has this problem has two projects in it.
One is an SDI executable. "Add Class" works on that project.
The other is a static library that contains helper functions and classes.
"Add Class" for a "MFC class" does not work for that one.
Is this expected?
The library contains many classes derived from MFC classes,
and the compilations and build work OK. It is just that I cannot
use "Add Class" to add a new MFC-derived class.

Thanks,
Marius
Gary Chang [MSFT] - 31 Oct 2003 10:10 GMT
Hi Marius

Thanks for your reply,

I have explored the the vcproj file of the static library project, but do
not find a general method to enable the Add MFC Class Wizard, however
manually editting the vcproj file is  also not a recommendded method.

In VS.Net 2003, the static library project is not supportted MFC class by
default, so if you really want to use the Add MFC Class Wizard, I think you
can generate the MFC class template in VS 6.0, then copy it to the project
files in VC7.1, maybe it is a "dirty" solution:-(

Regards!
Gary Chang
Microsoft Online Partner Support
Get Secure! ? www.microsoft.com/security
This posting is provided "AS IS" with no warranties,and confers no rights.
--------------------
| Reply-To: "Marius Matioc" <pentalogix@pentalogix.com>
| From: "Marius Matioc" <pentalogix@pentalogix.com>
| References: <ORxq$kpnDHA.2064@TK2MSFTNGP11.phx.gbl>
<MFti3tsnDHA.1544@cpmsftngxa06.phx.gbl>
| Subject: Re: "Add Class" problem
| Date: Thu, 30 Oct 2003 17:24:01 -0800
[quoted text clipped - 6 lines]
| Newsgroups: microsoft.public.vsnet.ide
| NNTP-Posting-Host: adsl-66-124-225-208.dsl.snfc21.pacbell.net
66.124.225.208
| Path:
cpmsftngxa06.phx.gbl!cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05
phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.vsnet.ide:8948
| X-Tomcat-NG: microsoft.public.vsnet.ide
[quoted text clipped - 13 lines]
| Thanks,
| Marius
Tony S - 25 Nov 2004 01:51 GMT
Having the same problem in a simplistic dll, I stumbled on a couple things to try.  Which I will post here for others who find this thread.  

1. Some other dude with this problem discovered that if he deleted his .ncb file, that did the job for him.

2. I discovered that I get this error when I remove/comment the "one and only" global object derived from CWinApp.  Even though the dll still builds and can be used!  Investigate whether it exists and whether its class is indeed derived from CWinApp.

e-mail me: scabbygoat@hotmail.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.