I have done some minor changes and now I'm getting the 'Object doesn't support this property or method' error message.
Code
'''''''''''''''''''''''''''''
Set MyEnvironment = DLL.DefineEnvironment(True)
' ''Create string variable
Set MyStr = MyEnvironment.New("LPSTR", 128)
b="1234567890123456"
Set Def_DLL = DLL.DefineDLL("AesEncryption")
Set Lib = DLL.Load("C:\QA Automation\FeeAlert\Automation\FunctionLibrary\AesEncryption.DLL")
' Registers the CryptDecrypt type in TestComplete
Call Def_DLL.DefineProc ("CryptEncrypt", VT_LPSTR, VT_LPSTR)
Set MyStr = DLL.New("LPSTR", 256)
MyStr.Text = b
' -------------Error -----------------
ddd= Lib.CryptEncrypt(MyStr)
'''''''''''''''''''''''''''