@fxm Thanks. Understood.
@sancho3
You made life a little difficult for me by mixing two methods so I had to use the 'comment out' trick to see where it broke.
I found that test = @moo() was needed by both methods otherwise I got a GPF.
However, I do not have a function name, like moo, to get an address. All I have is LibTest which is a pointer to the <"Entry point">.
This is the actual code:
At the head of WndProc ( Callback function ) I have
Code: Select all
Static As Long dllIsLoaded
Static As Any Ptr AES
and here is the failing code
Code: Select all
Case EncAES
If dllIsLoaded = 0 Then
Dim As Any Ptr library = Dylibload( "EncDecStretchCNG.dll" )
If library = 0 Then
TDWrapper Hwnd, "Loading failure", "Failed To load EncDecStretchCNG.dll", TD_ERROR_ICON
Exit Function
End If
Dim LibTest As Function( As Long, As Zstring, As Zstring, As Long ) As Long
LibTest = Dylibsymbol( library, "EncDecStretchCNG" )
If LibTest = 0 Then
TDWrapper Hwnd, "Entry Point falure", "Could Not retrieve the entry Point of EncDecStretchCNG", TD_ERROR_ICON
Exit Function
End If
dllIsLoaded = -1
AES = LibTest
End If
pwszName = AfxIFileOpenDialog(hwnd, All_Files2) ' Get file to encrypt
If pwszName Then
zAESName = *pwszName
CoTaskMemFree(pwszName)
zPassKey = AfxInputBox( Hwnd, 0, 0, "AES", "Please provide password/passkey", "", , True ) ' Get password/passkey
AES( AES256, zAESName, zPassKey, 0 )
End If
The statement AES( AES256, zAESName, zPassKey, 0 ) is the one failing.