Problem with Declare sub xxxDLL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ken

    #1

    Problem with Declare sub xxxDLL

    Newbie, having a problem upgrading from VB6 to dotNet.
    I am trying to call some subs from a NIST dll and I don't know how to
    call them in Net.

    I have used the Upgrade VB6 wizzard on my old source and got a Modual
    and a form.

    Module NIST_Module

    Public Declare Sub SETUPdll Lib "Refprop" (ByRef i As Integer,
    ByVal hfld As String, ByVal hfmix As String, ByVal hrf As String, ByRef
    ierr As Integer, ByVal herr As String, ByRef ln1 As Integer, ByRef ln2
    As Integer, ByRef ln3 As Integer, ByRef ln4 As Integer)


    Public Const MaxComps As Integer = 20
    Public herr, hfmix, htyp As String
    Public hrf As String
    Public htype, hmix, hcomp As String
    Public hfld As String, nc As Long
    Public ierr As Long
    "more stuff"
    End Module

    Public Class Form1
    Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
    System.EventArg s) Handles Button1.Click
    nc = 1
    hfld = "C:\NIST\fluids \nitrogen.fld"
    hfmix = "C:\NIST\fluids \hmx.bnc"
    hrf = "DEF"
    'setup for Nitrogen
    Call SETUPdll(nc, hfld, hfmix, hrf, ierr, herr, 10000&, 255&,
    3&, 255&)
    Unable to load DLL 'Refprop': The specified module could not be found.
    (Exception from HRESULT: 0x8007007E)
    'Get molecular weight:
    Call WMOLdll(x(1), wm)
    End Sub
    End Class


    What else do I need or what order do I need to do it in?
Working...