有如下的代码:implementation
  function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external 'KERNEL32.DLL';
{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
begin
  RegisterServiceProcess(GetCurrentProcessID, 1);//隐藏
  RegisterServiceProcess(GetCurrentProcessID, 0);//显示end;请问我在运行的时候,老是说无法定位程序输入点RegisterServiceProcess于动态库
KERNEL32。DLL上?有知道的能不能告诉我?

解决方案 »

  1.   

    据我所知,在"kernel32.dll"里并无此函数。兄台用的win2000?
      

  2.   

    你应把*.DLL文件拷贝到调用DLL的应用程序目录下.
      

  3.   

    试试
    function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external 'KERNEL32.DLL' name 'RegisterServiceProcess'
      

  4.   

    晕,没有仔细看,你调用的是KERNEL32.DLL中的api啊,这个不用你自己声明引用dll的,直接调用就可以了
      

  5.   

    to  hkbarton(宁静至远||淡泊明志):
    必须要声明的。
    不声明就出错。
      

  6.   

    TO aiunong(凡) :
    function RegisterServiceProcess(dwProcessID, dwType: DWord) : DWord; stdcall; external 'C:\WINNT\SYSTEM32\KERNEL32.DLL';也是不行的。
      

  7.   

    to  hkbarton(宁静至远||淡泊明志):function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external 'KERNEL32.DLL' name 'RegisterServiceProcess';也是不行的。
      

  8.   

    恩,刚才看了一下,的确是我错了,这个api好象delphi没有帮你封装(或是我没有找到在哪个单元),你看看用我说的第一个方法行不行,
      

  9.   

    to  hkbarton(宁静至远||淡泊明志):function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external 'KERNEL32.DLL' name 'RegisterServiceProcess';也是不行的。
      

  10.   

    [Error] Unit1.pas(27): Not enough actual parameters
      

  11.   

    或者直接用delphi自己在windows模块中重新声明的API函数,或者就把kernel32.dll拷到当前目录下试试
      

  12.   

    你应该指出'KERNEL32.DLL' 的绝对目录;
    function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external 'c:\winnt\system32\KERNEL32.DLL';参数不足,有一个地址和一个类型参数。
      

  13.   

    我早指过了,不行
    再说C:\WINNT\SYSTEM32  
    系统是能找到的。
      

  14.   

    这个是Windows9x的API,在2000/NT下一般是会出错的.
      

  15.   

    这个是Windows9x的API,在2000/NT下一般是会出错的.
      

  16.   

    楼主,解决问题最好好拉。
    其实也可以动态载入。
    下面我写了个函数,不过没调试过。function RegisterServer(dwProcessID, dwType: Integer): Integer; stdcall;
    var
      DllFileName:String;
      p:PChar;
      HInstance:integer;
      RegisterServiceProcess:function ( dwProcessID, dwType: Integer ): Integer; stdcall;
    begin
      DllFileName := StringOfChar( ' ', 256);
      p := PChar( DllFileName);
      GetSystemDirectory(p,255);
      StrCat(p,'\KERNEL32.DLL');
      HInstance := LoadLibrary( P );
      if HInstance = 0 then
        raise exception.Create('Kerner32 loading error');
      @RegisterServiceProcess := GetProcAddress( HHControlInstance, 'HtmlHelpA');
      if @RegisterServiceProcess = nil then
      raise exception.Create('Function RegisterServiceProcess cannot loaded!');
      result := RegisterServiceProcess(dwProcessID, dwType);
      //dwtype=1 隐藏
    end;
      

  17.   

    to 各位:
        我用的是 WIN2K ,你们说不技WIN2K,
    那么在 WIN2K 中应该怎么写?
      

  18.   

    各位:
      RegisterServiceProcess 在动态库 Kernel32.dll 中是没有的,
    所以会出现以上的情况!  请问 RegisterServiceProcess 在那个动态库中?
      有没有知道的?
      要注册一个服务,请问在 WIN 2K 中怎么写?  谢谢先!
      

  19.   

    win2k的服务实现方法不同,所以根本没有这个API。要通过WIN2K的SCM进行服务应用的开发。在MSDN里找Windows Service
      

  20.   

    谢谢各位啦!
        主要的原因就是在 WIN 98 中没有这个 API 函数!
        我要结了!!!