描述
这些构造函数注册OCX是合适的,许可或不.
语法
CONSTRUCTOR COleCon ( _ BYVAL pWindow AS CWindow PTR, _ BYVAL cID AS INTEGER, _ BYREF classID AS CONST CLSID, _ BYREF riid AS CONST IID, _ BYVAL x AS LONG = 0, _ BYVAL y AS LONG = 0, _ BYVAL nWidth AS LONG = 0, _ BYVAL nHeight AS LONG = 0, _ BYVAL dwStyle AS DWORD = 0, _ BYVAL dwExStyle AS DWORD = 0, _ BYVAL ambientFlags AS DWORD = 0 _ ) |
CONSTRUCTOR COleCon ( _ BYVAL pWindow AS CWindow PTR, _ BYVAL cID AS INTEGER, _ BYREF classID AS CONST CLSID, _ BYREF riid AS CONST IID, _ BYREF wszLicKey AS WSTRING, _ BYVAL x AS LONG = 0, _ BYVAL y AS LONG = 0, _ BYVAL nWidth AS LONG = 0, _ BYVAL nHeight AS LONG = 0, _ BYVAL dwStyle AS DWORD = 0, _ BYVAL dwExStyle AS DWORD = 0, _ BYVAL ambientFlags AS DWORD = 0 _ ) |
参数
pWindow |
对CWindow类用于创建窗体实例的指针. |
||||||||||||||||||||||||||
cID |
控件标识符.它必须是独一无二的. |
||||||||||||||||||||||||||
classID |
要创建的对象的CLSID,这样"{8E27C92B-1264-101C-8A2F-040224009C02}" |
||||||||||||||||||||||||||
riid |
要创建的对象的IID,这样"{8E27C92C-1264-101C-8A2F-040224009C02}". |
||||||||||||||||||||||||||
wszLicKey |
可选.如果控件已被授权,则该控件的许可密钥. |
||||||||||||||||||||||||||
x |
窗口的左上角相对于父窗口的客户区的左上角的x坐标. |
||||||||||||||||||||||||||
y |
相对于父窗口的客户区的左上角的窗口左上角的初始坐标. |
||||||||||||||||||||||||||
nWidth |
窗宽. |
||||||||||||||||||||||||||
nHeight |
窗口高度. |
||||||||||||||||||||||||||
dwStyle |
正在创建窗口的样式. |
||||||||||||||||||||||||||
dwExStyle |
正在创建的窗口的扩展样式. |
||||||||||||||||||||||||||
ambientFlags |
结合下面的旗帜,使用按位或运算符,表示你的喜好.
Most of the flag values have negative effects, that is, they prevent behavior that normally happens. For instance, scripts are normally executed by the WebBrowser Control if you don't customize its behavior. But if you set the DLCTL_NOSCRIPTS flag, no scripts will execute in that instance of the control. However, three flags桪LCTL_DLIMAGES, DLCTL_VIDEOS, and DLCTL_BGSOUNDS梬ork exactly opposite. If you set flags at all, you must set these three for the WebBrowser Control to behave in its default manner vis-a-vis images, videos and sounds. |
引用文件
COleCon.inc
示例
CONST IDC_WEBBROWSER = 1001
DIM pOleCon AS COleCon PTR = NEW COleCon(@pWindow, IDC_WEBBROWSER, _
@CLSID_WebBrowser, @IID_IWebBrowser2, 0, 0, pWindow.ClientWidth, pWindow.ClientHeight - 20)