用delphi作了个OCX,在装有delphi的机子上正常执行,没有装delphi的机子上显示如下后也可继续运行,是不是少了几个文件,如何不提示那个对话框?
http://61.177.181.108/bb/7/20031224160559%e6%9c%aa%e5%91%bd%e5%90%8d1.jpg

解决方案 »

  1.   

    在你安装有的delphi电脑中查看一下ntdll.dll文件放在什么地方,然后将其复制到其他电脑中试一下,看一下情况如何。
    看到这样的提示似乎是变量写入错误。
      

  2.   

    在软件启动时把ocx注册!方法如下:下面是注册flash的ocx
      GetSystemDirectory(SysPath,sizeof(SysPath)-1);
      if not Fileexists(strpas(SysPath)+'\Macromed\Flash\swflash.ocx') then
         begin
           StrPcopy(Dire,strpas(SysPath)+'\Macromed');
           CreateDirectory(Dire,nil);
           StrPcopy(Dire,strpas(SysPath)+'\Macromed\Flash');
           CreateDirectory(Dire,nil);
           StrPcopy(Source,extractfilepath(paramstr(0))+'swflash.ocx');
           StrPcopy(Dest,strpas(SysPath)+'\Macromed\Flash\swflash.ocx');
           CopyFile(Source, Dest, False);       OCXHand:= LoadLibrary(Dest);
           RegFunc:= GetProcAddress(OCXHand, 'DllRegisterServer');
           if RegFunc <> 0 then
             ShowMessage('错误!请与程序供应商联系');
           FreeLibrary(OCXHand);
        end;
      

  3.   

    我是用的数字签名 会自动提示用户注册的
    和ntdll.dll无关 安装和不安装delphi这个文件是一样的
      

  4.   

    还是这样
    http://61.177.181.108/bb/15/20040104083230%e6%9c%aa%e5%91%bd%e5%90%8d1.jpg
      

  5.   

    那要逐步排查一下了,这种问题我以前可没有遇到过,我只是遇到过下发程序时有一个dll文件没有下发也出现错误提示。我是用d6写的,文件是qtintf.dll。不知道你是否也是类似情况,找找看吧,祝顺