Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VBS to DLL to QTP
#2
Not Solved
Sorry you can't do it that way. You can create Classes in VBS then call the class.function, but they do not compile into DLLs. You need to use Visual Studio 6 or .NET to create dlls then install them as COM components in order to consume them in VBS/QTP. VS.NET does it pretty easily by selecting "Make Assembly COM visible" then registering. There are plenty of Google examples how to do this. You can even use the free Express editions of Visual studio to create and compile the dll files.

Easiest thing to do for QTP is create a VBS file then associate the file with your test/action in settings. You can still use classes.

Code:
'create class
Class TestMe
public sub HelloWorld()
   msgbox "Hello there"
end sub
End Class

'instantiate and consume
dim cltest: set cltest = New TestMe
cltest.HelloWorld

If you still wish to use DLLs then here is how. Create/compile dll using Visual studio. Register as COM component (Resasm.exe, I think...it's part of .NET utilities). Now QTP:
Code:
'if you use a namespace, don't forget to include it namspace.class
dim cltest:set cltest = CreateObject("cltestdll")
cltest.HelloWorld


I hope this helps.
Reply


Messages In This Thread
VBS to DLL to QTP - by ssco77 - 04-07-2010, 06:27 PM
RE: VBS to DLL to QTP - by jsknight1969 - 04-07-2010, 09:18 PM
RE: VBS to DLL to QTP - by shirkaan - 01-28-2011, 01:05 PM
RE: VBS to DLL to QTP - by cdesserich - 01-30-2011, 09:28 AM
RE: VBS to DLL to QTP - by jsknight1969 - 02-16-2011, 03:46 AM
RE: VBS to DLL to QTP - by prashants1 - 12-16-2011, 01:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  .vbs script error when trying to insert a value in a sapguitable frebuffi 5 6,503 07-18-2013, 03:04 PM
Last Post: Staff
  Running .dll files Aurodeepta 1 2,426 08-22-2012, 03:18 PM
Last Post: sshukla12
  Test COM and ATL DLL objects using VBScripting sree.85 0 1,910 08-16-2012, 01:00 PM
Last Post: sree.85
  Calling dll C# in VBScript nacchio 0 3,058 10-11-2011, 07:32 PM
Last Post: nacchio
Exclamation how to Pass Optional Parameters in VBS? ShrikantBiradar3449 1 7,961 06-13-2011, 03:12 AM
Last Post: Skepsis

Forum Jump:


Users browsing this thread: 1 Guest(s)