Thanks, I tried using your code as reference, like so:
Code from action, Flight_NewSale:
Code from function library, createObject:
But I get this error: ActiveX component can't create object: 'WinEdit':
When I check the values of the objects in watch, it says there that both txtName and objInst are empty. Since I'm really new to QTP, may I just confirm, are the codes you posted above both located in the function library (or both located in the action script), or are they from different locations (the line:
is found only in the action script and the function createDescription is located at the function library)?
in the action script, and the rest of the function createDescription in the
Thanks, tip about the micclass has been noted. However, I do know how to create descriptions of objects. What I want to know is, if I can create the descriptions of the objects using a function from the function library.
Code from action, Flight_NewSale:
Code:
Public txtName
...
Set txtName = createObject("WinEdit", "Arrival Time:")
Code from function library, createObject:
Code:
Public objInst
...
Public Function createObject(typeObject, valProperty)
Dim objInst ' as Object
Set objInst = Description.Create()
Select Case typeObject
Case "WinEdit":
objInst("Class Name").Value = "WinEdit"
objInst("attached text").Value = valProperty
Case "WinButton":
objInst("Class Name").Value = "WinButton"
objInst("text").Value = valProperty
End Select
Set createObject = objInst
End Function
But I get this error: ActiveX component can't create object: 'WinEdit':
Code:
Set txtName = createObject("WinEdit", "Arrival Time:")
When I check the values of the objects in watch, it says there that both txtName and objInst are empty. Since I'm really new to QTP, may I just confirm, are the codes you posted above both located in the function library (or both located in the action script), or are they from different locations (the line:
Code:
Set vo_ResDesc=createDescription("Link",DataTable("REScreateexport",dtGlobalSheet))
is found only in the action script and the function createDescription is located at the function library)?
in the action script, and the rest of the function createDescription in the
Thanks, tip about the micclass has been noted. However, I do know how to create descriptions of objects. What I want to know is, if I can create the descriptions of the objects using a function from the function library.