I don't think it matters terribly what language a DLL was created in. As
far as I know you need to know what functions a DLL exports, what parameters
it expects, what it returns and then you need to "declare" these things.
Here's an example of using a Windows DLL (advapi32.dll):
Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _
(ByVal lpBuffer As String, nSize As Long) As Long
Sub ShowUserName()
MsgBox UserName
End Sub
Function UserName() As String
Dim Buffer As String * 256
Dim BuffLen As Long
BuffLen = 256
If GetUserName(Buffer, BuffLen) Then _
UserName = Left(Buffer, BuffLen - 1)
End Function
--
Jim Rech
Excel MVP
|I have a C++ DLL libarary (not COM) that I want to use in
| VBA. Is it possible to use this library in VBA. If so,
| how?