Monday, December 10, 2012

How to register an OCX File?

var
   OCXHand: THandle;
begin
   OCXHand:=LoadLibrary('c:\windows\system\test.ocx');
   if (GetProcAddress(OCXHand,'DllRegisterServer')<&gtnil) then
     ShowMessage('Error!');
   FreeLibrary(OCXHand);
end;

**To unregister: Replace 'DllRegisterServer' to 'DllUnRegisterServer'

0 comments:

Post a Comment

 
Related Posts Plugin for WordPress, Blogger...