Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I get the error:

 

System.NullReferenceException: Object reference not set to an instance of an object.

at WindowsApplication2.Form1.decodes(String& strData, String& strFilename, Int32 lenData)

at WindowsApplication2.Form1.Form1_Load(Object sender, EventArgs e) in C:\Documents and Settings\admin\My Documents\Visual Studio Projects\WindowsApplication2\Form1.vb:line 69

 

 

here is all of the code except the windows form code.

 

 

Declare Function decodes Lib "./ladder.dll" Alias "decode" (ByVal strData As String, ByVal strFilename As String, ByVal lenData As Integer) As Integer

 

 

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim abc

Dim ii As Integer

abc = "12345"

 

Try

MsgBox(decodes(abc, "test.txt", Len(abc)))

Catch err As Exception

Me.RichTextBox1.Text = (err.ToString)

End Try

End Sub

 

 

help :(?

Posted
Firstly I would recomend putting

Option Strict On

 

at the top of the file and fixing any problems it generates (e.g. what data type is abc supposed to be declared as?)

Does the decode function always return a a value?

 

Thanks for the reply, been waiting on one all day :(

 

 

I added that as you said. no new errors. and the ABC is nothing honestly, ive just been trying to debug this. and im not sure if it always does.

  • Leaders
Posted
The error is being thrown in ladder.dll. What is ladder.dll? Is it managed? And what is decode supposed ot do? Its hard to figure out what is going wrong when we don't even know what is going on.
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...