想知道么
我告诉你:
var
MHandel : DWORD;
tmpstr : string;
begin
........
MHandel:= GetModuleHandle('Test02.ocx');
//获取注册该OCX文件的路径信息
tmpstr:= GetModuleName(MHandel);
tmpstr:= MidStr(tmpstr, 1, GetPathLength(tmpstr));
showmessage(tmpstr + '/config.mdb');
..........
end;
function TTestActiveFormX.GetPathLength(PathStr: string): integer;
var
i: integer;
begin
Result:= -1;
for i:= length(PathStr)do
wnto 1do
begin
if PathStr = '/' then
begin
Result:= i-1;
Break;
end;
end;
end;