QTP安装目录CodeSamplesPlus中的部分代码分析
QTP安装目录CodeSamplesPlus中的部分代码分析:文件:HighLightObject.vbs中:
Extern.Declare micHwnd, "GetDesktopWindow", "User32.DLL", "GetDesktopWindow"
Extern.Declare micULong, "GetWindowDC", "User32.DLL", "GetWindowDC", micHwnd
Extern.Declare micInteger, "ReleaseDC", "User32.DLL", "ReleaseDC", micHwnd, micULong
Extern.Declare micULong, "CreatePen", "Gdi32.DLL", "CreatePen", micInteger, micInteger, micDword
Extern.Declare micInteger, "SetROP2", "Gdi32.DLL", "SetROP2", micULong, micInteger
Extern.Declare micULong, "SelectObject", "Gdi32.DLL", "SelectObject", micULong, micULong
Extern.Declare micULong, "DeleteObject", "Gdi32.DLL", "DeleteObject", micULong
Extern.Declare micULong, "GetStockObject", "Gdi32.DLL", "GetStockObject", micInteger
Extern.Declare micULong, "Rectangle", "Gdi32.DLL", "Rectangle", micULong, micInteger, micInteger, micInteger, micInteger
我知道是声明必须的一些API,但我不理解上面具体的代码是什么意思,网友朋友们 有没有相关的通俗易懂的资料呢,大家讨论下吧 QTP调用DLL(Extern.Declare函数参数介绍)
QTP拥有自己的.NET Factory接口,以调用.NET生成的DLL,也可以使用Extern.Declare来进行外部的DLL的访问。
语法:
Extern.Declare(RetType, MethodName, LibName, Alias [, ArgType(s)])
参数说明:
RetType: 方法返回值的类型。
MethodName:调用DLL文件中的某个方法的方法名。
LibName: DLL文件名。
Alias: 别名,当别名为空时,方法名和别名一样(此参数通常为空)。
ArgType(s): 传入的参数。
具体的请查看http://blog.csdn.net/winterwinner/article/details/6270440 回复 2# xhhuang1618
:) 谢谢你, 说的很通俗易懂, 提供的资料也挺好
感谢!!
页:
[1]