Hi all
when executing my VB Code it tells me that
=>>error : DLL Call Convention is incorrect ...
Here are the essential lines i wrote in my VB code to use the DLL function :
________________________________________________________
Public Declare Function CWorkingDir Lib ".\MyDll.dll"
(ByVal WorkingDir As String) As Integer
Public Declare Function LoadLibrary Lib "kernel32" Alias
"LoadLibraryA" (ByVal lpLibFileName As String) As Long
Public Declare Function FreeLibrary Lib "kernel32"
(ByVal hLibModule As Long) As Long
Public Const DEF_MY_DLL As String =".\MyDll.dll"
........
.......
Sub Main()
.......
Dim intVar As Integer
IntRet = LoadLibrary(DEF_MY_DLL)
.......
intVar = CWorkingDir("."
.......
end Sub
_____________________________________________________
Ps : MyDll is a simple DLL without Class but only simple function exported in the conventional way
Please is there any suggestion or solution
thanx in advance
when executing my VB Code it tells me that
=>>error : DLL Call Convention is incorrect ...
Here are the essential lines i wrote in my VB code to use the DLL function :
________________________________________________________
Public Declare Function CWorkingDir Lib ".\MyDll.dll"
(ByVal WorkingDir As String) As Integer
Public Declare Function LoadLibrary Lib "kernel32" Alias
"LoadLibraryA" (ByVal lpLibFileName As String) As Long
Public Declare Function FreeLibrary Lib "kernel32"
(ByVal hLibModule As Long) As Long
Public Const DEF_MY_DLL As String =".\MyDll.dll"
........
.......
Sub Main()
.......
Dim intVar As Integer
IntRet = LoadLibrary(DEF_MY_DLL)
.......
intVar = CWorkingDir("."
.......
end Sub
_____________________________________________________
Ps : MyDll is a simple DLL without Class but only simple function exported in the conventional way
Please is there any suggestion or solution
thanx in advance