Object refernce not set (newbie question)

  • Thread starter Thread starter JH
  • Start date Start date
J

JH

"Object reference not set to an instance of an object" is the error I got
whenever I run a code that has the following. It crashes when Itry to assign
Bob with the sysInfo1.OSPlatform
Dim SysInfo1 As SysInfoLib.SysInfo

Dim Bob As Short

......

Bob = SysInfo1.OSVersion

.....
 
* "JH said:
"Object reference not set to an instance of an object" is the error I got
whenever I run a code that has the following. It crashes when Itry to assign
Bob with the sysInfo1.OSPlatform
Dim SysInfo1 As SysInfoLib.SysInfo

Why do you soll use the library and not the .NET classes/methods for
this purpose? You never instantiate the class, you will have to use
something like this (notice the 'New' keyword):

\\\
Dim SysInfo1 As New SysInfoLib.SysInfo()
///
 
Back
Top