http://pastebin.com/R9eXK9gX
No tuve ningun problema en pasar todas funciones, pero me he trabado en esta parte (CryptDecrypt y CryptEncrypt)
Código
Private Declare Function CryptEncrypt Lib "advapi32.dll" (ByVal hKey As Long, ByVal hHash As Long, ByVal Final As Long, ByVal dwFlags As Long, ByVal pbData As String, ByRef pdwDataLen As Long, ByVal dwBufLen As Long) As Long Private Declare Function CryptDecrypt Lib "advapi32.dll" (ByVal hKey As Long, ByVal hHash As Long, ByVal Final As Long, ByVal dwFlags As Long, ByVal pbData As String, ByRef pdwDataLen As Long) As Long
Código
'Encrypt or decrypt depending on the Encrypt parameter lLength = Len(Text) If (Encrypt) Then If (CryptEncrypt(hKey, 0, 1, 0, Text, lLength, lLength) = 0) Then '<--- DUDA! No se como pasarlo a CAbN Call Err.Raise(vbObjectError, , "Error during CryptEncrypt.") End If Else If (CryptDecrypt(hKey, 0, 1, 0, Text, lLength) = 0) Then '<--- DUDA! Call Err.Raise(vbObjectError, , "Error during CryptDecrypt.") End If End If
Agradeceria que alguien me explique como hacer para usar el CAbN en esos dos casos.
Supongo que voy a poner el codigo final (con todas las funciones pasadas a CAbN) cuando resuelva esta parte.