关于加控件的问题,请求您的指点。
用VC的MFC ACTIVEX CONTROL WIZARD做一个控件,工程名为line,功能就是画一条线。CLineCtrl类的OnDraw函数如下:
void CLineCtrl::OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
// TODO: Replace the following code with your own drawing code.
pdc->FillRect(rcBounds, CBrush::FromHandle((HBRUSH)GetStockObject(WHITE_BRUSH)));
pdc->Ellipse(rcBounds);
pdc->LineTo (50,120);
}
其中只有 pdc->LineTo (50,120); 是后添的,执行后通过,将生成的Line.ocx在C:\WINDOWS\SYSTEM\inetsrv中注册成功。
在ASP中使用语句:
<http>
<body>
<%
set mtstest=server.createobject("line.ClineCtrl")
mtstest.ondrow
set mtstest=nothing
%>
</body>
</http>
为什么告诉我创建对象失败呢?怎么才能让图形在浏览器中显示呢?