DPLOTLIB.DLL with VB 2008
Posted: Thu Jul 08, 2010 5:30 pm
David:
I successfully developed an application with VB 2005 that called DPLOTLIB.DLL using the example included with the software:
Recently I migrated to VB 2008 but the code does not run anymore; it stops in the line:
and reports the following message:
and recommends to:
Has somebody reported the same problem with VB 2008 ?
Thanks.
Mao
I successfully developed an application with VB 2005 that called DPLOTLIB.DLL using the example included with the software:
Code: Select all
Public Sub DPlot_FindDPLOTLIB()
' Find DPLOTLIB.DLL.
Dim key As Microsoft.Win32.RegistryKey
Dim path As String
Dim hLib As IntPtr
hLib = LoadLibrary("dplotlib.dll")
If hLib <> 0 Then
' If LoadLibrary finds the DLL, then so will VB.NET, so there's
' no need to look in the registry or change the current
' directory
FreeLibrary(hLib)
Exit Sub
End If
key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\\DPLOT\\DPLOTLIB\\Folder")
path = key.GetValue("").ToString()
key.Close()
If Len(path) > 0 Then
System.Environment.CurrentDirectory = path
End If
End Sub
Code: Select all
path = key.GetValue("").ToString()
Code: Select all
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Code: Select all
Use the "new" keyword to create an object instance.
Thanks.
Mao