0

I'm writing a COM object that provides access to a service that must be explicitly connected before calls can succeed.

Is there a generic HRESULT code that describes that the callee object is in a state where it is unprepared to handle calls, ideally with the implication that this is the caller's fault?

Currently I'm using E_FAIL, which is too generic for my taste; OLE_E_BLANK might be an option, however this is not an OLE object and I'd rather not return a confusing error code.

Simon Richter
  • 28,572
  • 1
  • 42
  • 64

1 Answers1

1

I would suggest that E_NOT_VALID_STATE would be closest to what you want to convey. But, as Hans says, implement IErrorInfo to give chapter and verse.

Chris Dickson
  • 11,964
  • 1
  • 39
  • 60