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 2007

Tip: Looking for answers? Try searching our database.

C++/CLI control null exceptions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dragonslayer008@hotmail.com - 17 Sep 2007 20:32 GMT
Hello group,

I'm making a custom control in C++/CLI.  The control builds fine.  To
test the control, I made a C# Forms application.  On the Toolbox, I
right clicked and chose "Choose Items".  I then browsed for my control
DLL and added it.  The custom control now shows up in the toolbox.  I
then drag this control onto the form.

I then get exceptions about null objects.  I don't get this.  How can
I get exceptions when the program isn't even running?  Some of the
objects will be null until I "new" them...
Sheng Jiang[MVP] - 18 Sep 2007 04:50 GMT
Your control failed to load in Visual Studio
Set Visual Studio as your debug target to debug this problem.
> Hello group,
>
[quoted text clipped - 7 lines]
> I get exceptions when the program isn't even running?  Some of the
> objects will be null until I "new" them...
Carl Daniel [VC++ MVP] - 18 Sep 2007 07:08 GMT
> Hello group,
>
[quoted text clipped - 7 lines]
> I get exceptions when the program isn't even running?  Some of the
> objects will be null until I "new" them...

The program IS running... but the program, in this case, is Visual Studio
itself.

The forms designer instantiates your control with the default constructor
and then interrogates all of the properties using reflection..  You need to
make sure that all properties of your control are readable on a
default-constructed instance of your class or you won't be able to use it in
the designer.

-cd

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.