[yoy - Why-O-Why]yoy - “Why-O-Why”

» frame | home browse filter search | refresh | log on

  printed zondag 19 mei 2013 14:51:15 from www.yoy.be

how-to
Comment...
Add another
Add child
Edit
Move
Delete
Add token
Add reference

COM/ActiveX objects and Windows Vista and newer

Applications that provide one or more ActiveX/COM automation objects, created with older versions of Delphi, running without administrative privileges, throw an EOleSysError when strarting up (typically from within the Application.Initialize;). This is because the application will try to register its type library and class registrations when it starts. Add this unit to the project to silent this error at run-time:

unit comFixW6;

interface

implementation

uses Windows, SysUtils, ComObj;

var
  SaveInitProc:pointer=nil;

procedure FixComInitProc;
begin
  try
    if SaveInitProc<>nil then TProcedure(SaveInitProc);
  except
    on e:EOleSysError do if e.ErrorCode<>TYPE_E_REGISTRYACCESS then raise;
  end;
end;

initialization
  SaveInitProc:=InitProc;
  InitProc:=@FixComInitProc;

end.

location: Application Development > Programming Languages > Object Pascal > Delphi > ActiveX / COM objects
created: 2/02/2012 21:55:51 « modified: 2/02/2012 22:01:41 (diff) weight: 0

children, tokens, references comments (1)

delphi up down edit   del   created: 2/02/2012 21:55:59 « modified: 2/02/2012 21:55:59 weight: 0