![]() |
|
#1
|
|||
|
|||
|
Hi,
I have a simple automation server written in delphi 7 that works fine under previous versions of Windows, but fails on Windows 7. When the application is run in the IDE, an OLE error code of -2147319780 is returned. A Google search informs me this is an access denied code. I have run Process Monitor which confirmed ACCESS DENIED for the RegCreateKey operation. I then checked permissions in RegEdit. There is only one user on the machine, however both users and administrators are listed in Regedit permissions with the same user name. Giving Users the same full control as Administrators for HKEY_CLASSES_ROOT, then running the application again, allows the registration process to progress further; now the type library GUID is listed under HKCR\typelib, but the process still fails when it tries to add keys in HKCR\Wow6432Node\Interface. I've checked permissions for this, and they are full control for both users and administrators, so I am now officially stuck. The other entries in permissions is SYSTEM, which has full control, and CREATOR OWNER which is listed as special and applies to sub keys only. I would be very grateful to anyone who can shed light on how to resolve this problem. Please accept my thanks in advance, CAnder1 |
|
#2
|
|||
|
|||
|
Hi,
The issue isn't with Automation; it is to do with key creation, and since this is a registry problem, it should not appear in this forum. Using the following code confirmed that attempts to create a key to HKEY_CLASSES_ROOT\Wow6432Node are denied (at least on my machine): procedure TForm1.Button1Click(Sender: TObject); var Reg: TRegistry; begin Reg := TRegistry.Create; try Reg.RootKey := HKEY_CLASSES_ROOT; if Reg.OpenKey('\Wow6432Node', False) then begin Memo1.Lines.Add('interface key opened'); if Reg.CreateKey('Test Sub Key') then memo1.Lines.Add('key added'); Reg.CloseKey; end; finally Reg.Free; end; end; Running this with Process Monitor running confirms the same problem as when attempting to register the automation object. In spite of this, a key can be manually added using RegEdit. If anyone has encountered this problem before, I would be grateful to hear from them. Regards, CAnder1 |
|
#3
|
|||
|
|||
|
You don't need that Wow6432Node
This is automatically added when you use a 32bit app on a 64bit OS HKCR\Wow6432Node\Interface should be readed as HKCR\Interface |
|
#4
|
|||
|
|||
|
So I have no x64 to try at the moment, but it should be something like:
Code:
procedure TForm1.Button1Click(Sender: TObject);
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_CLASSES_ROOT;
if Reg.OpenKey('\', False) then
begin
Memo1.Lines.Add('interface key opened');
if Reg.CreateKey('Test Sub Key') then memo1.Lines.Add('key added');
Reg.CloseKey;
end;
finally
Reg.Free;
end;
end;
|
|
#5
|
|||
|
|||
|
Hi Norrit,
Thanks for the replies. I have tried both OpenKey with '\' and '\Interface' and both are Denied Access. I think, based on some furious Googling, that the issue is trying to register an out of process 32 bit server on a 64 bit machine. I have found several references to using utilities in the Windows\SysWOW64 folder to allow 32 bit servers to be registered on 64 bit machines (such as RegSvr32), but these are expecting either DLL or OCX (which are in process?), and complain when I try to use them to register the 32 bit server. As yet I haven't been able to find any resources on registering .exe type 32 bit servers on 64 bit machines, apart from an article on how to force an application to start as 32 bit: CorFlags /32BIT+ application.exe but haven't tried this; had issues downloading SDK. Regards, CAnder1 |
|
#6
|
|||
|
|||
|
Hi,
The problem turned out to be the Windows 7 User Access Control (UAC) under User Accounts in the Control Panel. Setting the slider control to Never Notify, then rebooting the machine, allowed the Automation server to register without any problems. It doesn't explain how I'm able to load other servers such as Office without having to alter this setting, however it's good enough for me. Thanks again to Norrit for your input. Regards, CAnder1 |
![]() |
| Thread Tools | |
| Display Modes | |
|
|