Wrox Programmer Forums
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 29th, 2006, 10:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default User Control Not Defined?

I am converting an old 1.1 .NET Windows application to 2.0. The conversion wizard claimed success, but one of my user defined controls (only one of several used) is returning "Object reference not set to an instance of an object". I used to get this in VS 2003, but as it didn't seem to effect anything I ignored it. VS 2005 won't let me use the form designer, however, which makes it very painful to change the form.

What more does VS 2005 need to eliminate this warning and let me use the designer?
 
Old March 29th, 2006, 11:15 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

I figured this one out. The user control was defined to the forms, but a global object referenced by code in a property in the user control is not initialized until run time. The forms that referenced it were trying to set a value for the property in the form initialization code and were getting an error trying to display the object in the designer. I placed the global object reference inside a try/catch and the problem went away.





Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB.Connection user-defined type not defined Wall st Guru Excel VBA 2 March 26th, 2014 03:44 PM
User-defined functions fredh Excel VBA 1 May 7th, 2007 10:28 AM
User-defined type not defined (Icecream.mdb) dloren01 BOOK: Beginning Access VBA 0 June 22nd, 2005 10:36 PM
user defined templates clandestine XML 2 June 15th, 2005 08:27 AM
User Defined Function niravp SQL Server 2000 7 November 29th, 2004 02:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.