Question:
I’m running Windows NT 4.0 (Service Pack 3) and have developed an ActiveX Server (EXE) using Visual Basic 6 (Service Pack 3). How come whenever I try to create a new instance of a class within this EXE file, I get this error message: “Permission Denied, ActiveX component can’t create object”?
When I check the event log, I see:
Can't start DCOM-server: Error: "Permission Denied. "Happened at startup of the following command: myserver.exe -Embedding
When I run my EXE and try to create an instance of a class it works just fine. Also, when I set it up to be created remote it works just fine. But as soon as I set it up to run locally I get these error messages.
I have played with DCOMCNFG.EXE and tried many of the combinations, but with no results.I recently used Windows 98 and had no such problems. My guess is that it has something to do with security, or lack of permissions.
Answer:
There are a couple of reasons why you could be getting the error. You could actually lack permissions to write the EXE (it’s unlikely, but you can check quickly by right-clicking on the file in NT Explorer, selecting the Properties menu item, and then the Security tab).
You could also be getting the error because the EXE is read-only. This can happen when Visual SourceSafe gets confused. Again, you can quickly check it via the same method above, only look for the Read-Only checkbox on the General tab.
The most likely reason why you get the error is that you have a copy of the EXE running, and Windows NT (correctly) won’t allow you to overwrite a running program. (Windows 95/98, on the other hand, lets you shoot yourself in the foot with great gusto.)
To check this possibility, simply start Task Manger (right-click on a blank area of the task bar and pick Task Manager, or hit Ctrl-Alt-Del and select Task Manager there). Look through the list of tasks and close the running copy of your ActiveX EXE.