473,382 Members | 1,336 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

C++/CLI control null exceptions

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...

Sep 17 '07 #1
2 1471
Your control failed to load in Visual Studio
Set Visual Studio as your debug target to debug this problem.
<dr*************@hotmail.comwrote in message
news:11*********************@o80g2000hse.googlegro ups.com...
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...
Sep 18 '07 #2
dr*************@hotmail.com wrote:
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...
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
Sep 18 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Miyra | last post by:
Hi. I'm working with an app that uses exceptions for control flow. These are code blocks where exceptions are thrown/caught regularly. A couple hundred exceptions occur per hour and they're caught...
9
by: Alvin Bruney [MVP] | last post by:
Exceptions must not be used to control program flow. I intend to show that this statement is flawed. In some instances, exceptions may be used to control program flow in ways that can lead to...
7
by: Dave | last post by:
Hi, I've read a few contradictory statements on how to do flow control between methods. Main problem is that I've seen recommendations (or "standards") to *not* use exceptions for flow control,...
11
by: BoloBaby | last post by:
OK, check this out... I have a form with a panel control and button on it (outside the panel control). I have two event handlers - one handles the click event of the button on the form. The...
6
by: Shane Story | last post by:
I am trying to add the Microsoft Web Browseractive X control to a vb.net form. I always get an error on the EndInit line. Parts of the errors says: "Unknown error" "First Chance...
4
by: James Page | last post by:
I can't seem to get HtmlTextWriter / renderControl to work for sending a control (html) in an e-mail messsage (VB.NET). Keeps telling me that control needs to be in a form tag with runat server...
18
by: Denis Petronenko | last post by:
Hello, in the following code i have segmentaion fault instead of exception. Why? What i must to do to catch exceptions in such situation? Used compiler: gcc version 3.3.6 (Debian 1:3.3.6-13) ...
22
by: dvestal | last post by:
Suppose I have this: class C { public delegate void MyEventHandler(); public event MyEventHandler MyEvent; public void foo() { MyEvent(); // NullReferenceException? } }
2
by: =?Utf-8?B?SlA=?= | last post by:
Hi all. I'm having a problem with a postback issue and I think it's cache related. Here's my setup: I have a web site that has a signup section. This has simple things like name, age, birth...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.