在windows系统中,可以通过Regsvr32来实现注册ocx或者dl, 编程时,调用Regsvr32来注册,却不能正常执行.尤其是在Win7系统中,需要管理员身份才能运行. 使用下面的代码则能正常注册. //注册 function RegisterDllServer(FileName: string): boolean; var nDllAddr: integer; bstr: string; ProcAddr: Pointer; str: PAnsiChar; begin Result :…
来源:转载 it won't work for you unless you have some form of Visual Basic tools loaded on your system: COMDLG32.OCX : Common Dialog -- this allows you to use code to open up a dialog box , select a file , and the commit that file.... then some more cod…
注意 COM组件注册到注册表中的位置,是CLSID还是TypeLib 注册方法 代码执行 //声明注册方法 [DllImport("C:\\Windows\\barcodex.ocx")] public static extern int DllRegisterServer();//注册时用 //DLL注册 int i = DllRegisterServer(); if (i >= 0) { return true; } else { return false; } 调用控制台执…