1. Build a class in c# (get C# express)
2. Class Library
3. Create a class MyQTP.cs with small code in Myfunction(a,b)
4. go in properties
5. Click on Assembly information button
6. Make Assembly com visible
7. Go to Build
8. Register com interop
9. Open QTP
Set oDLLCom = CreateObject("QTP.UI.Automation.MyQTP")
msgbox oDLLCom.Myfunction(a,b)
Note:
When we build the DLL in Visual Studio then it automatically enters all the Method in registry.To use the DLL on another machine we need to use RegAsm.exe to register it.
When we build the DLL in Visual Studio then it automatically enters all the Method in registry.To use the DLL on another machine we need to use RegAsm.exe to register it.