Click here to Skip to main content
15,902,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
What is the problem with this program:

VB
Private Sub ButtonDecharger_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles ButtonDecharger.Click

       Try

       SpyModem.GetModemMemory(TypeModem, numModem, BytesNumber, memoryModem)
       TextBox1.Text = TypeModem
       TextBox2.Text = numModem

       TextBox4.Text = memoryModem
        Catch ex As Exception
       MsgBox("Erreur ")
       End Try
   End Sub

The Methode "GetModemMemory" is included in a library dll.
When i click in the Button "ButtonDecharger" i get this problem:

"Additional information: Object reference not set to an instance of an object."

All the others méthodes works good, is just this want that doesn't work.Where is the problem?.
Thank you
Posted
Comments
Syed Shabeer 31-Jul-13 6:14am    
My guess is,

Any of these variables TypeModem, numModem, BytesNumber, memoryModem has null value

Have you tried debugging?
♥…ЯҠ…♥ 31-Jul-13 6:16am    
Debug the application and trace out the line where this particular error raised?
alonetmr 31-Jul-13 7:44am    
Hi,
In fact, these variables:TypeModem, numModem, BytesNumber, memoryModem are not null. The problem comes when I click on the button: ButtonDecharger.
What do you think about this expression?
SpyModem.GetModemMemory(TypeModem, numModem, BytesNumber, memoryModem)
Is just a simple methode. I can't found the problem.
Thanks

1 solution

First of all, read comments to the question.

Next, please, read this: System.NullReferenceException – Object reference not set to an instance of an object. 3 common causes in VB.Net.[^] to find a way how to avoid above error.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900