1

I have a COM object that is being called from a windows service, this COM is actually a .net dll registered via Regasm.exe.

In my windows service it is failing when I try to create an object with an error saying it could not create the COM object.

When I change the windows service "Log On" details to my account (rather than Local System Account) it works fine and the COM object is created OK.

So I am not sure how to fix this, it is something to with either how I am registering the COM via Regasm (I have tried both "run as admin" and without) or some permission on the "Local System Account" that it is not quite right.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Andrew
  • 691
  • 6
  • 17
  • [CoCreateInstance](https://msdn.microsoft.com/en-us/library/windows/desktop/ms686615.aspx) returns an `HRESULT`, that conveys more information than *"could not create the COM object"*. What does it return? – IInspectable Jan 19 '16 at 02:30
  • Thanks, the error returned is -2147024809 which I believe is "The parameter is incorrect.". I'm not sure what parameter it is referring to, as I mentioned before it seems to work if I change the service "Log On" detailsto my account. – Andrew Jan 19 '16 at 04:30
  • I still haven't been able to solve this, I have a hunch it is something to do with windows accounts and regasm. – Andrew Jan 20 '16 at 22:26

0 Answers0