J
John Dann
I'm trying unsuccessfully to access some functions within an external
DLL; sorry I don't know much about DLL classification, but AFAIK it's
not an ActiveX DLL, but a vanilla one written probably in C.
I've copied the DLL to my project folder (mydll.dll), but beyond that
haven't added any reference to it because I can't see how and don't
know if I need to anyhow.
My class code consists of (just one function as an example):
Imports System.Runtime.InteropServices
Public Class VPWLIO
<DllImport("mydll")> _
Public Shared Function OpenCommPort_V(ByVal comport As Int16,
ByVal baudrate As Integer) As Int16
End Function
End Class
(Sorry the word wrap has broken the lines a little)
I can instantiate this class OK in the calling module and Intellisense
shows up the method so that part's OK. But on running the project I
get an error that the DLL can't be loaded.
This is the first time I've tried to do this and so I'm probably
making some fundamental mistake, but can anyone shed any further light
please?
NB The function name inside the DLL is documented to be exactly how
I've spelled it in the function definition.
TIA
JGD
DLL; sorry I don't know much about DLL classification, but AFAIK it's
not an ActiveX DLL, but a vanilla one written probably in C.
I've copied the DLL to my project folder (mydll.dll), but beyond that
haven't added any reference to it because I can't see how and don't
know if I need to anyhow.
My class code consists of (just one function as an example):
Imports System.Runtime.InteropServices
Public Class VPWLIO
<DllImport("mydll")> _
Public Shared Function OpenCommPort_V(ByVal comport As Int16,
ByVal baudrate As Integer) As Int16
End Function
End Class
(Sorry the word wrap has broken the lines a little)
I can instantiate this class OK in the calling module and Intellisense
shows up the method so that part's OK. But on running the project I
get an error that the DLL can't be loaded.
This is the first time I've tried to do this and so I'm probably
making some fundamental mistake, but can anyone shed any further light
please?
NB The function name inside the DLL is documented to be exactly how
I've spelled it in the function definition.
TIA
JGD