How to solve a 0x800401E3(MK_E_UNAVAILABLE) error with IIS?

1

The preamble:
We are developing a REST interface that gets live data from an embedded controller. There is a UI that talks to the embedded controller and has a COM interface that provides access to pertinent data. The REST interface connects via COM to get the necessary data. This all works fine with IIS Express, but not with IIS.
Guid myGUID = new Guid( "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" ); Object ppunk; nResult = GetActiveObject( ref myGUID, IntPtr.Zero, out ppunk );
The result with IIS is 0x800401E3(MK_E_UNAVAILABLE).

I understand that IIS is running in Session 0 and that the UI is running in Session # (typically 1). IIS Express runs in Session 1 with the UI so all is well. I presume that due to the different Session numbers, GetActiveObject() does not operate on the Running Object Table (ROT) in which the UI has registered its COM interface, hence my MK_E_UNAVAILABLE problem.

So, is there a way around the above situation?
Launching the UI from IIS in the user session is not an option. The UI should already be running and since it is connected to a single embedded controller, multiple instances would not be good.
Launching a process in the user session from IIS that connects to the UI appears to be a possibility, but adding another level of indirection is not desirable.

Sage advice on the path to a solution would be appreciated.

c#
iis
com
asked on Stack Overflow Jul 29, 2016 by JWB4

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0