用ATL做的组件都可以被ASP调用: 如用ATL生成组件jycom13,如下是接口解释文件: // The begin of JYCOM13.idl // JYCOM13.idl : IDL source for JYCOM13.dll //// This file will be processed by the MIDL tool to // produce the type library (JYCOM13.tlb) and marshalling code.import "oaidl.idl"; import "ocidl.idl"; [ object, uuid(1448A79D-2D74-47A1-840F-95985BE4B90E), dual, helpstring("IjyBizImpl Interface"), pointer_default(unique) ] interface IjyBizImpl : IDispatch { [id(1), helpstring("method RouteFunction")] HRESULT RouteFunction([in] long fid, [in] VARIANT iClientInfo, [in]VARIANT iParam, [in, out] VARIANT* oParam, [out,retval] VARIANT_BOOL* bRetval); };[ uuid(6141D717-310F-462B-BE27-5155CDF14A22), version(1.0), helpstring("JYCOM13 1.0 Type Library") ] library JYCOM13Lib { importlib("stdole32.tlb"); importlib("stdole2.tlb"); [ uuid(98D41389-833E-4AEE-A6B9-BC97B5585726), helpstring("jyBizImpl Class") ] coclass jyBizImpl { [default] interface IjyBizImpl; }; }; // The end of JYCOM13.idl 程序生成后在iis所在服务器注册 在asp中服务器端程序生成和调用该组件.其语法分别可能是vbscript或javascript,如下是生成该组件的vbscript调用 // The begin of asp <% fid = 13111 iClientInfo = "nothing" iParam = "input info" oParam = "output info" Set objJYUI = CreateObject ("JYCOM13.jyBizImpl") If objJYUI.RouteFunction(fid,iClientInfo,iParam,oParam) Then Response.write "true" Else Response.write "false" End If %> // The end of asp
做ASP的COM开发,分页写在COM里,怎么弄啊?谢谢,最好给我个例子
如用ATL生成组件jycom13,如下是接口解释文件:
// The begin of JYCOM13.idl
// JYCOM13.idl : IDL source for JYCOM13.dll
//// This file will be processed by the MIDL tool to
// produce the type library (JYCOM13.tlb) and marshalling code.import "oaidl.idl";
import "ocidl.idl";
[
object,
uuid(1448A79D-2D74-47A1-840F-95985BE4B90E),
dual,
helpstring("IjyBizImpl Interface"),
pointer_default(unique)
]
interface IjyBizImpl : IDispatch
{
[id(1), helpstring("method RouteFunction")]
HRESULT RouteFunction([in] long fid,
[in] VARIANT iClientInfo,
[in]VARIANT iParam,
[in, out] VARIANT* oParam,
[out,retval] VARIANT_BOOL* bRetval);
};[
uuid(6141D717-310F-462B-BE27-5155CDF14A22),
version(1.0),
helpstring("JYCOM13 1.0 Type Library")
]
library JYCOM13Lib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb"); [
uuid(98D41389-833E-4AEE-A6B9-BC97B5585726),
helpstring("jyBizImpl Class")
]
coclass jyBizImpl
{
[default] interface IjyBizImpl;
};
};
// The end of JYCOM13.idl 程序生成后在iis所在服务器注册
在asp中服务器端程序生成和调用该组件.其语法分别可能是vbscript或javascript,如下是生成该组件的vbscript调用
// The begin of asp
<%
fid = 13111
iClientInfo = "nothing"
iParam = "input info"
oParam = "output info"
Set objJYUI = CreateObject ("JYCOM13.jyBizImpl")
If objJYUI.RouteFunction(fid,iClientInfo,iParam,oParam) Then
Response.write "true"
Else
Response.write "false"
End If
%>
// The end of asp