asp.net中利用JS调用Delphi开发的ocx里面的方法提示对象不支持此属性或方法
Delphi开发的ActiveX代码如下:
function TActiveFormX.getnew(const strid: WideString; i: Integer): WideString;
var sqlstr:string;
var strnum:string;
var strZhiqu:string;
var strQudao:string;
var strCity:string;
begin
qry1.Close;
qry1.SQL.Clear;
sqlstr:='select * from yj_tableinfo where yj_id=:yj_id';
qry1.SQL.Text:=sqlstr;
qry1.Parameters.ParamByName('yj_id').Value:=strid;
qry1.Open;
case i of
1: begin
strnum:=qry1.FieldByName('yj_table_21').AsString;
strZhiqu:=qry1.FieldByName('yj_table_1').AsString;
strQudao:=qry1.FieldByName('yj_table_22').AsString;
s1:=split(strnum,'*');
s2:=split(strZhiqu,'*');
s5:=split(strQudao,'*');
for i := 0 to s1.Count-1 do
begin
checkstr[i]:=Copy(s1[i],1,Length(s1[i])-1);
end;
for i := 0 to s2.Count-1 do
begin
zhiquStr[i]:=Copy(s2[i],1,Length(s2[i])-1);
end;
for i := 0 to s5.Count-1 do
begin
qudaoStr[i]:=Copy(s5[i],1,Length(s5[i])-1);
end;
//打印
frprtK.PrepareReport;
frprtK.PrintPreparedReport('',1,true,frall);
end;
end;
end;
此方法在Delphi发布的网页中测试是没错的
在asp.net网站中调用的时候是这样写的
<object id='obj' classid="clsid:5511CF5A-C7BD-4777-B5EC-3D0E771E207B" codebase="ActiveFormProj1.ocx#version=1,0,0,0"
width="350" height="250" align="center" hspace="0" vspace="0">
</object>
function PrintShow()
{
document.obj.getnew('2012031500001',4);
}
写成这样也不执行document.getElementById('obj').getnew('2012031500001',4);
<input id="btnKKK" type="button" name="打印测试" runat="server" onclick="PrintShow()" value="打印测试" />
OCX也已经注册到System32了,但是执行起来就是提示对象不支持此属性或者方法,在Delphi发布的测试页中测试一点问题没有,求高手指点下问题出在哪里了,头都炸了快....
------解决方案--------------------
up,有大虾给解决下的吗