473,406 Members | 2,356 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,406 software developers and data experts.

Cannot get rid of these exceptions

Again I need your help, cuz I'm out of idea !

I get an error at runtime at the indicated line :
System.NullReferenceException occured in MyApp.exe

If I continue, I get :
System.TypeInitializationException occured in unknown module ...

Help on these matters is chinese to me.

In a standard module :
'====
Public tbxOtherPilotFullPath As Collection = New Collection

Sub tbxOPENTBXCFG(ByVal sMyFullPath As String)
Dim t As String
Dim SR As StreamReader = New StreamReader(sMyFullPath)

While Not t = vbNullString
t = SR.ReadLine()
tbxOtherPilotFullPath.Add(t) '<=== Error here !!!
End While

SR.Close()
End Sub
'====

When hovering on the variable t, it shows the expected string.
I have been feeding collections many times without a problem
so I can't understand why it don't work this time.

Thank you for any help.
Patrick

Nov 20 '05 #1
1 861
Because the call to the sub was made from MyForm Sub New()
I just discovered (finally) this was the *REAL* entry point of my app
before Sub Main() although indicated in the app property page,
therefore the collection was never initialized.

The teaching is 'I will never again call an external sub from New()'
(it took me a while !) ;-(
P.

"Patrick Penet" <ph***********@club-internet.fr> a écrit dans le message de news:40**********************@news.club-internet.fr...
Again I need your help, cuz I'm out of idea !

I get an error at runtime at the indicated line :
System.NullReferenceException occured in MyApp.exe

If I continue, I get :
System.TypeInitializationException occured in unknown module ...

Help on these matters is chinese to me.

In a standard module :
'====
Public tbxOtherPilotFullPath As Collection = New Collection

Sub tbxOPENTBXCFG(ByVal sMyFullPath As String)
Dim t As String
Dim SR As StreamReader = New StreamReader(sMyFullPath)

While Not t = vbNullString
t = SR.ReadLine()
tbxOtherPilotFullPath.Add(t) '<=== Error here !!!
End While

SR.Close()
End Sub
'====

When hovering on the variable t, it shows the expected string.
I have been feeding collections many times without a problem
so I can't understand why it don't work this time.

Thank you for any help.
Patrick

Nov 20 '05 #2

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

Similar topics

0
by: Erlend Fuglum | last post by:
I have tried and tried, but cannot figure out the source of the following error: AttributeError: 'module' object has no attribute 'menyHMTL' __doc__ = 'Attribute not found.' __getitem__ =...
3
by: Michael | last post by:
I have a problem with catching the OutOfMemoryException in a managed C+ application. When creating small objects on the managed heap neithe the catch handler for OutOfMemoryException nor the...
3
by: news.microsoft.com | last post by:
I got this error "Object type cannot be converted to target type" in my VB Winforms application. When I click on it, it goes no where, how do I troubleshoot this? Thank you.
2
by: Jarmo | last post by:
I have a Java-based (Axis) Web Service and am trying to write a .NET client in C#. I run into two different problems. 1. if the WSDL was generated using the Axis defaults then .NET cannot update...
5
by: Martin Robins | last post by:
I know that this has been asked before; and not only that, I know that it has been answered (successfully) as I myself have previously resolved the problem (with help) - however, I cannot for the...
1
by: Hennesey | last post by:
Hello all, I am developing a Visual Studio .Net 2005 application that consumes an Axis 1.3 web service. Importing the WSDL file generates an error "cannot resolve apachesoap:Map type" ...
3
by: thomson | last post by:
Hi All, Are there any sort of exceptions that cannot be caught by the Runtime, Any Insights? Thanks in Advance thomson
2
by: Brent K | last post by:
Ok, I have an internal intranet website created in visual studio 2005, c#. It was running fine for months, and then all of the sudden a few days I started getting these errors emailed to me (I have...
6
by: Dave | last post by:
I really don't like the users getting an unhandled expception page, and I'm still to new with ASP.Net and C#. So please accept my appology for the 2 part question. SqlException (0x80131904) ...
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.