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 / September 2006

Tip: Looking for answers? Try searching our database.

Add Class works differently in vs2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill Below - 23 Sep 2006 06:17 GMT
I am moving Win32 console app that works fine, as built by VS2003, to VS2005.
This app automates Excel and in 2003 used Project/Add Class to create header
files that included all methods and did not include an #import directive.

In 2005, Add Class creates smaller header files with #import directives.  
The resulting tlh file is huge and generates a huge number of errors.  C4430
is predominant.

What am I doing wrong?

Thanks,
Bill Below
Ramanathan Kathiresan [MSFT] - 25 Sep 2006 09:13 GMT
Hello Bill,

Greetings,

What is Compiler Warning C4430
==============================

Compiler Warning C4430  

Error Message
missing type specifier - int assumed. Note: C++ does not support default-int

This error can be generated as a result of compiler conformance work that
was done for Visual C++ 2005: all declarations must now explicitly specify
the type; int is no longer assumed. See Breaking Changes in the Visual C++
2005 Compiler for more information.

C4430 is always issued as an error. You can turn off this warning with the
#pragma warning or /wd; see warning or /w, /Wn, /WX, /Wall, /wln, /wdn, /wen,
/won (Warning Level) for more information.

Example that generaes C4430
==============================
The following sample generates C4430
========================================

// C4430.cpp
// compile with: /c
struct CMyClass {
  CUndeclared m_myClass;  // C4430
  int m_myClass;  // OK
};

typedef struct {
  POINT();   // C4430
  // try the following line instead
  // int POINT();
  unsigned x;
  unsigned y;
} POINT;

Breaking Changes in VS 2005:
==============================
Compiler will not inject int as the default type in declarations
Code that is missing the type in a declaration will no longer default to
type int the compiler will generate Compiler Warning C4430 or Compiler
Warning (level 4) C4431. Standard C++ does not support a default int and this
change will ensure that you get the type you really want.

Links that talks:
=================
http://msdn.microsoft.com/visualc/default.aspx?pull=/library/en-us/dnvs05/html/T
ransGuide.asp

http://msdn2.microsoft.com/en-us/library/11321bfc-2def-4d4d-89f9-db8d5635e797.aspx
http://msdn2.microsoft.com/en-us/library/ms177253.aspx

HTH,
Ram
Signature

Ramanathan Kathiresan
VC++ | C# | J# | Developer Support Team
Microsoft R&D Corporation

http://blogs.technet.com/rams/default.aspx
http://blogs.msdn.com/ramanathan%5Fkathiresan/

> I am moving Win32 console app that works fine, as built by VS2003, to VS2005.
> This app automates Excel and in 2003 used Project/Add Class to create header
[quoted text clipped - 8 lines]
> Thanks,
> Bill Below
Bill Below - 25 Sep 2006 21:58 GMT
Ram,

I gave C4430 as an example.  My real problem is that it is produced by code
in excel9.tlh which is produced by the IDE at compile time so there is no
point in "fixing" it.

Ideally, I would like to find some way to get the Add Class from Typelib
Wizard in VS2005 to act like VS2003 and produce CApplication.h, CRange.h etc
containing complete wrappers and no #import directives and eliminate the
75,000 line tlh and tli files.

Failing that, I would like to find some way to make VS2005 produce a tlh
file that will compile.

Thanks,
Bill

> Hello Bill,
>
[quoted text clipped - 66 lines]
> > Thanks,
> > Bill Below

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.