NullReferenceException was unhandled

SUGGESTED

I just took the Business Object Interface class and I copied from the class document in Visual Basic and I am getting an NullReferenceException was unhandled error message. The following is my code:

Hello Rob,

 

I am trying to do a simple VB program to show the pathSystem and I keep getting an error that displays: An unhandled exception of type 'System.NullReferenceException' occurred in Microsoft.VisualBasic.dll

Public Class Form1

    Inherits System.Windows.Forms.Form

    Dim oScript As Object

    Dim oSS As Object

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e _

                           As System.EventArgs) Handles MyBase.Load

        oScript = CreateObject("ProvideX.Script")

        oScript.Init("D:\Sage\Sage 100 Premium ERP\MAS90\Home")

        oSS = oScript.NewObject("SY_Session")

    End Sub

 

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        MessageBox.Show(oSS.sPathSystem)

    End Sub

End Class

 

Any ideas on what could cause this?

 

Mike

Parents
  • 0
    SUGGESTED

    You need to add a reference to Interop.ProvideX.dll to your project.

    This is a COM reference, titled "ProvideX OLE Server Library"

    Once you do this, I would suggest changing your instantiation line to a more standard .NET format:

    Dim oScript As ProvideX.Script
    oScript = New ProvideX.Script

    This will give you some help from intellisense.

Reply
  • 0
    SUGGESTED

    You need to add a reference to Interop.ProvideX.dll to your project.

    This is a COM reference, titled "ProvideX OLE Server Library"

    Once you do this, I would suggest changing your instantiation line to a more standard .NET format:

    Dim oScript As ProvideX.Script
    oScript = New ProvideX.Script

    This will give you some help from intellisense.

Children
No Data