I am trying to get the machine name of the computer that is running my application but i keep getting this error (it's on the line that is in bold):

Object reference not set to an instance of an object.

VB Code:
  1. Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2.         AxAnimation1.Open(Application.StartupPath & "\EARTH_SPIN.avi")
  3.         MachineName = Space$(64)
  4.         CompNameSize = Len(MachineName)
  5.         [B]Compname = GetComputerName(MachineName, CompNameSize)[/B]
  6.         Compname = Trim(MachineName)
  7.         Label1.Text = Compname
  8.     End Sub

It looks like i needed to declare somethin....i think. Does anyone see a problem?