组件写好了,在本机测试没有问题,拿到别的机器上在createobject时就没有反应了,
整个IIS都好象停止响应,不接受任何ASP请求
整个IIS都好象停止响应,不接受任何ASP请求
解决方案 »
- treeview动态菜单
- stringgrid汇总问题
- DBGRIDEH中的过滤功能问题
- 谁有delphi 军旗源码,借我一份
- 使用ADO链接UTF8编码的数据库,为什么从数据库里面提取出来的字符串少最后一位字节啊?
- 在DBChart画布上画线,写字的问题
- dephi 报表问题,急!急!
- 我是新手,请问我是学PB好 还是学Delphi好?还是学VB.net?
- 十万火急!!! ehlib25中的printdbgrid 如何设置横向打印。老板等着要,请帮助!!!
- 用CreateDesktop创建一个非交互状态的桌面(即不在屏幕上显示的桌面),怎样才能向其发送键盘和鼠标的输入消息和获取其桌面图像?
- 请帮忙看看一条查询语句(有答案就结帐)
- 一个常识,不是很难,也不太好描述,热心人进来来看看!
代码马上贴
ComServ,
Unit1 in 'Unit1.pas' {Myobj: CoClass},
MyOle_TLB in 'MyOle_TLB.pas';exports
DllGetClassObject,
DllCanUnloadNow,
DllRegisterServer,
DllUnregisterServer;{$R *.TLB}{$R *.RES}begin
end.---------unit Unit1;
interfaceuses
ComObj, ActiveX, AspTlb, MyOle_TLB, StdVcl;type
TMyobj = class(TASPObject, IMyobj)
private
protected
procedure OnEndPage; safecall;
function OnStartPage(const Punk: IUnknown): Integer; safecall;
function GetData(const Str: WideString): WideString; safecall;
end;implementationuses ComServ;procedure TMyobj.OnEndPage;
begin
//inherited OnEndPage;
end;function TMyobj.OnStartPage(const Punk: IUnknown): Integer;
begin
//
end;function TMyobj.GetData(const Str: WideString): WideString;
begin
RESULT:=Str;
end;initialization
TAutoObjectFactory.Create(ComServer, TMyobj, Class_Myobj,
ciMultiInstance, tmApartment);
end.--------unit MyOle_TLB;// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //// PASTLWTR : 1.2
// File generated on 2003-12-12 14:44:39 from Type Library described below.// ************************************************************************ //
// Type Lib: C:\ASP组件\新建文件夹 (2)\MyOle.tlb (1)
// LIBID: {C0AFE794-15D5-44AB-9C93-8CD2AE4F30B2}
// LCID: 0
// Helpfile:
// HelpString: MyOle Library
// DepndLst:
// (1) v2.0 stdole, (C:\WINNT\System32\stdole2.tlb)
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interfaceuses Windows, ActiveX, Classes, Graphics, StdVCL, Variants;
// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:
// Type Libraries : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Non-DISP interfaces: IID_xxxx
// *********************************************************************//
const
// TypeLibrary Major and minor versions
MyOleMajorVersion = 1;
MyOleMinorVersion = 0; LIBID_MyOle: TGUID = '{C0AFE794-15D5-44AB-9C93-8CD2AE4F30B2}'; IID_IMyobj: TGUID = '{B07CC87B-C9A5-4D75-A68F-DE1CB7DC75B3}';
CLASS_Myobj: TGUID = '{EC2D4951-8142-4FA5-9949-FD7B4F13EF8A}';
type// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
IMyobj = interface;
IMyobjDisp = dispinterface;// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
Myobj = IMyobj;
// *********************************************************************//
// Interface: IMyobj
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {B07CC87B-C9A5-4D75-A68F-DE1CB7DC75B3}
// *********************************************************************//
IMyobj = interface(IDispatch)
['{B07CC87B-C9A5-4D75-A68F-DE1CB7DC75B3}']
function OnStartPage(const Punk: IUnknown): Integer; safecall;
procedure OnEndPage; safecall;
function GetData(const Str: WideString): WideString; safecall;
end;// *********************************************************************//
// DispIntf: IMyobjDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {B07CC87B-C9A5-4D75-A68F-DE1CB7DC75B3}
// *********************************************************************//
IMyobjDisp = dispinterface
['{B07CC87B-C9A5-4D75-A68F-DE1CB7DC75B3}']
function OnStartPage(const Punk: IUnknown): Integer; dispid 1;
procedure OnEndPage; dispid 2;
function GetData(const Str: WideString): WideString; dispid 3;
end;// *********************************************************************//
// The Class CoMyobj provides a Create and CreateRemote method to
// create instances of the default interface IMyobj exposed by
// the CoClass Myobj. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoMyobj = class
class function Create: IMyobj;
class function CreateRemote(const MachineName: string): IMyobj;
end;implementationuses ComObj;class function CoMyobj.Create: IMyobj;
begin
Result := CreateComObject(CLASS_Myobj) as IMyobj;
end;class function CoMyobj.CreateRemote(const MachineName: string): IMyobj;
begin
Result := CreateRemoteComObject(MachineName, CLASS_Myobj) as IMyobj;
end;end.
回答:
上传编译好的DL,并注册
PS:公司的服务器注明一下:
我的开发机是WIN2K FAT32,服务器是NTFS
与这个有关?
fat fat32的分区没有权限可言,nt在fat分区下未能控制权限仅仅是密码。
但是ntfs不一样了,每个文件每个目录都有独立的读 写 执行 等等权限控制会不会是你需要访问的组件没有合适的权限?iis的asp调用的任何一个com组件对应的dll文件最起码都要有IUSR_机器名 IWAN_机器名
这两个帐号的读权限,你设置对了吗?
直接用ASP访问该组件导致DLLHOST异常
偶自己重新拿了块硬盘全部用NTFS分区并重装WIN2K SERVER,测试后也正常可拿到公司服务器上就出现DLLHOST异常,一开始我就怀疑可能是WINDOWS SCRIPT版本问题 于是升级,问题依然得不到解决。
更奇怪的是,我在网上找到一个delphi写的多文件快速上传的COM,附source的,他里面有自己编译好的DLL,我拿到出问题的那台机器上注册,用ASP调用,结果:正常。然后把他的代码重新编译一次,再拿到那台机器上,问题又出现了。偶不明白。
问题找到了
这2天到处找资料 发现 只要请把Tools->Environment options->Type Library->Language设为Pascal就好了