我要写一个delphi的程序,这个程序的功能是将自己的dll文件写到注册表中,这个程序如何实现?
谢谢各位!

解决方案 »

  1.   

    用系统(win2000以上)自带的DLL注册程序regsvr32.exe,把你要注册的DLL文件的全路径+文件名作为该程序的参数执行就可以了。
    具体可以用下面的方法调用该注册程序:FileName: String = 'c:\myDLL.dll';
                  ……
    WinExec(PChar('regsvr32.exe ' + FileName), 0);若要反注册一个DLL,可以这样:FileName: String = 'c:\myDLL.dll';
                  ……
    WinExec(PChar('regsvr32.exe /d ' + FileName), 0);
      

  2.   

    use ComObj;procedure RegisterComServer(const DLLName: string);
    Description
    COM servers are always registered as dynamic link libraries, DLLs. The DLLName parameter specifies the name of the DLL that implements the COM controls.
      

  3.   

    2000以下怎么办?
    这个com怎么用?
      

  4.   

    win98也支持的。但是,这样注册的只是Com的dll,不是普通的Dll
      

  5.   

    普通的Dll -- 需要注册吗???