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 / Languages / Managed C++ / September 2004

Tip: Looking for answers? Try searching our database.

Header files / CPP files ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tom - 18 Sep 2004 18:55 GMT
This has got to be something really simple, but I'm pretty baffled...[VC++
.NET 2003]

In the header file I define the class interfaces, in the CPP file the class
functions, and the
CPP file  #includes the header file. Looks like Stroustrup style code.

The only way I can get it to complile is to declare (again) the class within
the cpp file.

If I don't redeclare it but instead just put all the
Classname::Method(parameters){ code };
in the CPP file,  I get thousands of compile errors.  They seem to object
whenever I use any of
the managed types. The functions that don't use anything but ints, etc. seem
to compile OK.

What is simple that I'm missing?

 -- Tom
Tom - 18 Sep 2004 20:05 GMT
Geez...

Shutdown and rebooted, then fired up VC.NET and most of the errors
disappeared...
The ones that were left had to do with  __property  keyword.  Apparently
it's a declaration
type of keyword, so just had to remove it from the .CPP file were the
properties are coded.

.H file:

_gc public class MyClass
{
private:
 int MemberVal;
public:
 __property int get_MemberVal();
}

.CPP file:

// bad   __property int MyClass::get_MemberVal() { return MemberVal };

// good
int MyClass::get_MemberVal() {return MemberVal };

Sure am puzzled whey shutting down and rebooting cleared so many compile
errors...
(even after forced rebuild_all).

 -- Tom

> This has got to be something really simple, but I'm pretty baffled...[VC++
> .NET 2003]
[quoted text clipped - 16 lines]
>
>  -- Tom

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.