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 / .NET Framework / New Users / August 2005

Tip: Looking for answers? Try searching our database.

a few MC++ / (Plain C++ really) questions about constructor & exception

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lloyd Dupont - 01 Aug 2005 01:15 GMT
- if I use the default new operator, are all the instance variable
initialize to NULL / 0 ?
- if there is not enough memory what happend with new ? does it return NULL
or throw an exception?
- if new throw a native C++ exception what happen in Managed C++ ?!
- if there is an exception in a construtor, is ~MyClass() called?
- if I want to throw an exception in a constructor should I free all native
type before? or should I throw and let the destructor (which check nullity
before deleting) do its job?

Signature

There are 10 kinds of people in this world. Those who understand binary and
those who don't.

William DePalo [MVP VC++] - 01 Aug 2005 04:58 GMT
>- if I use the default new operator, are all the instance variable
>initialize to NULL / 0 ?
[quoted text clipped - 5 lines]
> native type before? or should I throw and let the destructor (which check
> nullity before deleting) do its job?

I suggest that you post again in

   microsoft.public.dotnet.languages.vc

Regards,
Will
Lloyd Dupont - 01 Aug 2005 06:02 GMT
"William DePalo [MVP VC++]" <willd.no.spam@mvps.org> wrote in message news:%
> I suggest that you post again in
>
>    microsoft.public.dotnet.languages.vc

That's a good idea!
I didn't though of that as I don't usually do C++ programing....
But in some case, surprisingly, Managed C++ is much leaner...
William DePalo [MVP VC++] - 01 Aug 2005 18:38 GMT
> But in some case, surprisingly, Managed C++ is much leaner...

It really excels when you need to make use of both managed and native
classes in the same module or executable by providing the "it just works"
capability as well as  Platform/Invoke available to all the other languages.

Regards,
Will
Lloyd Dupont - 04 Aug 2005 09:25 GMT
so true ;-)

Signature

There are 10 kinds of people in this world. Those who understand binary and
those who don't.

>> But in some case, surprisingly, Managed C++ is much leaner...
>
[quoted text clipped - 5 lines]
> Regards,
> Will

Rate this thread:







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.