在设计一个Activexdll类型的自动化组件时,源代码中用到了一个Activex单元中的 OleLoadPictureFile函数,程序成功编译了,但是在类型库编辑器中注册这个dll的时候出现错误,错误内容是:the ole control may require support library which are not on the current serach path or not in the current system.
去掉这个函数就可以注册成功,所以我保证是由于这个函数造成的注册失败。
我很奇怪:注册就是把Guid,proid写到注册表里,怎末还会报错说库找不到。
//===================================================================
类的结构如下:其中ICustomMaker是我引用的一个接口。这个接口有三方法,draw,resetdc,setupdc.(这些介绍可能与我的问题无关)
TGisPonitAddPic = class(TAutoObject, IGisPonitAddPic, ICustomMarker)
protected
function Draw(hDC, x, y: Integer): HResult; stdcall;
function ResetDC(hDC: Integer): HResult; stdcall;
function SetupDC(hDC: Integer; dpi: Double;
const pBaseSym: IDispatch): HResult; stdcall;
procedure setfilename(const filename: WideString); safecall;
{ Protected declarations }
end;
去掉这个函数就可以注册成功,所以我保证是由于这个函数造成的注册失败。
我很奇怪:注册就是把Guid,proid写到注册表里,怎末还会报错说库找不到。
//===================================================================
类的结构如下:其中ICustomMaker是我引用的一个接口。这个接口有三方法,draw,resetdc,setupdc.(这些介绍可能与我的问题无关)
TGisPonitAddPic = class(TAutoObject, IGisPonitAddPic, ICustomMarker)
protected
function Draw(hDC, x, y: Integer): HResult; stdcall;
function ResetDC(hDC: Integer): HResult; stdcall;
function SetupDC(hDC: Integer; dpi: Double;
const pBaseSym: IDispatch): HResult; stdcall;
procedure setfilename(const filename: WideString); safecall;
{ Protected declarations }
end;
>>path or not in the current system.
提示是說這個 ActiveX 需要一個支持的 library 找不到, 可能是個dll, 那你檢查
你那個函數, 是引用那個庫的, 將那個文件copy到 windows/system32 下就可!