Hello,

I have an ATL service that is serving up a COM interface to another app I'm building. Here's the issue:

Code:
MULTI_QI     qi;
		HRESULT hr;
		

		qi.pIID = &IID_ISecMan;
		qi.pItf = NULL;
		//qi.hr = 0;
		
      hr = CoCreateInstanceEx(CLSID_SecMan, NULL, CLSCTX_LOCAL_SERVER, NULL, 1, &qi);

		if (FAILED(hr))
		{
			throw -1;
		}
When I compile the service and then immediately go to my app and run the code above, the CoCreateInstance() returns the OK result and everything goes fine. The COM calls fail of course, but that's expected from what I understand (I'm new to COM).

However, if I compile the service and then go to the command line and enter "smservice /service" to register it, the service manager lists SMService and I can start it.

Then I call the above code and instead of OK, it returns ACCESSDENIED every time. The only way to get it to stop is to completely remove SMService from the service manager.

What have I missed?