M
man8888
Unregistered / Unconfirmed
GUEST, unregistred user!
很多人说用CreateCOMObject的方法创建对象,如果成功了算注册了,但是我现在连PROGID,CLASSID都不知道,还有人说用Regsvr32.exe进行注册等等,我不是问如何注册,是如何判断是否注册,我就光知道一个abc.dll文件名,别的什么都不知道,能判断么???
CreateCOMObject方法判断的代码如下:
uses ComObj, ActiveX;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
clsID: TGUID;
obj: IUnknown;
begin
CLSIDFromProgID('test.test', clsID);
obj:= CreateCOMObject(clsID);
if obj <> nil then
ShowMessage('registered')
else
ShowMessage('not registered');
end;
CreateCOMObject方法判断的代码如下:
uses ComObj, ActiveX;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
clsID: TGUID;
obj: IUnknown;
begin
CLSIDFromProgID('test.test', clsID);
obj:= CreateCOMObject(clsID);
if obj <> nil then
ShowMessage('registered')
else
ShowMessage('not registered');
end;