壹
壹平
Unregistered / Unconfirmed
GUEST, unregistred user!
我用用"Regsvr32.exe"和"OleRegister"注册“ocx”都不成功,都提示类没有注册不知为何请教各位大侠!谢谢了!
用Regsvr32.exe:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, OleCtrls, WINFLICLib_TLB;
type
TForm1 = class(TForm)
flc: TWinflic;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
WinExec('Regsvr32.exe /s winflic.ocx', sw_Normal);
form1.SetBounds (0,0,screen.width,screen.height);
button1.SetBounds ((screen.width-button1.width),(screen.height-button1.height),button1.width,button1.height);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
flc.SetBounds ((screen.width-640) div 2,(screen.height-480) div 2,640,480);
flc.FileName :=('pt.flc');
end;
end.
用TOleRegister:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
OleCtrls, WINFLICLib_TLB, StdCtrls, ExtCtrls, MPlayer;
type
TForm1 = class(TForm)
flc: TWinflic;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
nextframe:integer;
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
type
TOleRegister = function : HResult;
var
hLib : THandle;
fnAdr: TFarProc;
Result:BOOLEAN
begin
hLib := LoadLibrary('winflic.ocx');
if (hLib > 0) then
begin
fnAdr := GetProcAddress(hLib, pchar('DllRegisterServer'));
if (fnAdr <> nil) then
begin
Result:=(TOleRegister(fnAdr)>=0);
if (Result) then
MessageBox (0,
'Register Success',
'Warning',
MB_ICONEXCLAMATION or MB_OK);
end;
end;
FreeLibrary(hLib);
form1.SetBounds (0,0,640,480);
flc.SetBounds(0,0,640,480);
flc.filename:='pt.flc';
end;
end.
用Regsvr32.exe:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, OleCtrls, WINFLICLib_TLB;
type
TForm1 = class(TForm)
flc: TWinflic;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
WinExec('Regsvr32.exe /s winflic.ocx', sw_Normal);
form1.SetBounds (0,0,screen.width,screen.height);
button1.SetBounds ((screen.width-button1.width),(screen.height-button1.height),button1.width,button1.height);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
flc.SetBounds ((screen.width-640) div 2,(screen.height-480) div 2,640,480);
flc.FileName :=('pt.flc');
end;
end.
用TOleRegister:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
OleCtrls, WINFLICLib_TLB, StdCtrls, ExtCtrls, MPlayer;
type
TForm1 = class(TForm)
flc: TWinflic;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
nextframe:integer;
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
type
TOleRegister = function : HResult;
var
hLib : THandle;
fnAdr: TFarProc;
Result:BOOLEAN
begin
hLib := LoadLibrary('winflic.ocx');
if (hLib > 0) then
begin
fnAdr := GetProcAddress(hLib, pchar('DllRegisterServer'));
if (fnAdr <> nil) then
begin
Result:=(TOleRegister(fnAdr)>=0);
if (Result) then
MessageBox (0,
'Register Success',
'Warning',
MB_ICONEXCLAMATION or MB_OK);
end;
end;
FreeLibrary(hLib);
form1.SetBounds (0,0,640,480);
flc.SetBounds(0,0,640,480);
flc.filename:='pt.flc';
end;
end.