473,834 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

NullReferenceEx ception with Application.Pro ductName

Hi,

I am trying to set the status bar of my form to include the product
name and product version.

Here is my code:

Private Sub initStatusBar()
Dim sSBText as String = Application.Pro ductName & Space(3) &
"v" & Application.Pro ductVersion
sb.Text = sSBText
End Sub

When I run this I get:

An unhandled exception of type 'System.NullRef erenceException '
occurred in system.windows. forms.dll
Additional information: Object reference not set to an instance of an
object.

I cannot understand why - you cannot create an instance of the
Application class and nor should you have to, right?

Any ideas?

Thanks,

James.

P.S - It's definately the Application bit that is wrong - because this
produced the same error:

Dim Fullname As String = Application.Pro ductVersion.ToS tring
MsgBox(Fullname )

Also, where in Visual Studio do I change the Product Name and
Version?
Thanks.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 20 '05 #1
1 1827
* do**********@de monit.co-dot-uk.no-spam.invalid (DemonIT) scripsit:
I am trying to set the status bar of my form to include the product
name and product version.

Here is my code:

Private Sub initStatusBar()
Dim sSBText as String = Application.Pro ductName & Space(3) &
"v" & Application.Pro ductVersion
sb.Text = sSBText
End Sub

When I run this I get:

An unhandled exception of type 'System.NullRef erenceException '
occurred in system.windows. forms.dll
Additional information: Object reference not set to an instance of an
object.
Are there any further infos on the exception?
I cannot understand why - you cannot create an instance of the
Application class and nor should you have to, right?


I don't understand why.

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Nov 20 '05 #2

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

Similar topics

3
9148
by: Terrence | last post by:
I am doing some of the C# walkthroughs to transition from VB to C#. When I try to execute static void Main() { Aplication.Run(new Form1()) } I raise a 'System.NullReferenceException" in system.windows.forms.dll
2
312
by: Phil Galey | last post by:
I created a VB.NET application, together with an associated installation project, and in the installation project I specified the ProductName. But when I run the application, if I try to retrieve the ProductName using Application.ProductName, it always returns an empty string. I've looked under Solution Properties, but haven't found anything. How do I get Application.ProductName to return the application product name? Thanks.
2
6505
by: A.M | last post by:
Hi, In vb.bet we have Application object that gives us information about application name and path (like Application.ProductName). How can i have Application object functionality in C# ? Thanks, Ali
2
13130
by: Chang | last post by:
how to get the name of a running application using C# e.g. if i have 20 dll files and my application name is MyGreatApplication then how to get the name "MyGreatApplication" at runtime? thx in adv. c
5
555
by: AAguiar | last post by:
I have an asp.net project where the code behind the aspx page calls a c# class which makes calls to a managed static C++ class. The C# class works fine when the asp net worker process starts, when it is invoked by pressing "F5", or when the web.config file is modified. In all these cases the web.config file contains <identity impersonate="false" />. The mysterious problem arrises when I set <identity impersonate="true"/> in the...
8
6056
by: mike2036 | last post by:
I have an application (that has unmanaged code) and when I launch it without 'FullTrust' permissions (LocalIntranet_Zone), it crashes. When I set 'FullTrust' permissions, it launches fine. Is there a way I can compile the application such that it won't even attempt to launch without correct permissions instead of just crashing? Thanks for any help. -Mike
2
3022
by: Chubbly Geezer | last post by:
Does anyone have any experience of this functionality. I have started to swap out my connection code for the std functionality within these dll's. The data connection is fine, I can also run commands and return datasets. However, the example they use to update a dataset is awful. It seems to reply on hard coded sql store procedures (3 for each table) in order to work. This is so much more unfriendly than the standard process of updating...
1
9207
by: =?Utf-8?B?QW5kcmV3?= | last post by:
Hello, friends, In our c#.net 2005 project, I clicked on project property. At application tab of property page, clicked on Assembly Information... button, All boxes were left blank, including Product text box, Run the app, checked value of Application.ProductName, and there was a value for this property! I thought this value was defined in Product text box mentioned above, but,
1
1569
by: Cind | last post by:
I have to populate a listbox with details of a particular customer. For example, you may want to view a Customer with the current products for that Customer. List Box should display the current prouct name registered by that customer. Here goes my try, Form1.cs: private void ProductsRegistered(string UserName, string productID) { UserData.ProductsRegistered proreg = userdata.GetRegisteredProducts(UserName,...
0
9796
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10789
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10504
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10544
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9327
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5624
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5790
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.