RPA | DLL in Automation Anywhere| Automation Anywhere- Part-53
DLL in Automation Anywhere - In this blog we will discuss another useful and interesting action or package provided by Automation Anywhere i.e. DLL or Dynamic Link Library. We will also see the working of DLL package or action using A2019 Automation Anywhere also known as Automation 360.
Before we dig deep into DLL using Automation Anywhere first of all we will discuss what are DLL or dynamic link library.
What is DLL?
A DLL is a library that contains code and data which can be used by more than one program at the same time. By using DLL, a program can be modularized into separate components. For example, the Comdlg32 dll performs common dialog box related functions. Each program can use the functionality that is contained in this dll to implement Open dialog box. It helps promote code reuse and efficient memory usage.
So now we will see each of the actions or commands present under DLL in detail one by one which is as follows:
- Open Action - This command is used to add a user specified DLL reference which can be used in the run action. As of now only C# DLLs are supported. To use this action it requires bot agent version which will be 21.89 or above. In the properties section we need to pass in the DLL file which can be present either in the control room, desktop location or we can store the location of the DLL file in a variable and can use that variable and also we need to pass the session name which would be used further in the actions that we will be using in our process.
- Run Function Action - This command is used to run the specific DLL function with parameters. To use this action it requires bot agent version which will be 21.89 or above. In the properties section pass in the same session name which we gave in the open action, then enter the namespace name, pass in the class name and the name of the function which is to be executed. Then click on the Add parameters to add the required parameters needed for the DLL execution and then finally assign the output to a string variable data type.
- Close Action - This action is used to close the DLL reference. To use this action it requires bot agent version which will be 21.89 or above. In the properties section we just need to pass in the same session name which we gave in the Open action.
- We will pass the BitcoinPrice.dll to the open action where we need to select the file.
- Then using the run action we need to pass the namespace as BitcoinPrice, then the name of the function as GetPriceOfBitcoin, class name as GetBitcoinPrice, then add currency parameter as USD in the parameters section and store the output in vBitCoinPrice variable of string data type.
- Use the message box to display the output so pass in the variable name created in step 2 in the message box field.
- Now run the bot to check the output. You will receive an error message i.e. could not load file or assembly RestSharp as this dll file is the dependency for the BitcoinPrice.dll to execute. So add the dependent file and then try to run the bot and now this time we will receive the output.
how to create the dll?
ReplyDeletehttps://www.youtube.com/watch?v=qc_YxmgU1q4
ReplyDeletein case if DLL dint close(missed), how to close at backend.. any workaround to close ..
ReplyDelete