I am trying to connect IBM communicator EHLLAPI (PCSHLL32.dll).
I have created webAPI to connect IBM PCOMM windows communicator. In visual studio I am able to establish connection with communicator and working all good. However when I deployed on IIS ,I am getting return 1 in response which means connection not established with communicator or invalid session.
Can any one guide me where I stuck on IIS level.
SO when I debug from visual studio ,here connect get value "0" which means it is connected. But On when it is hosted on IIS the service return 1.
Why I am getting 1 instead of 0.
public class EhllapiFunc
{
[DllImport("PCSHLL32.dll")]
public static extern UInt32 hllapi(out UInt32 Func,
StringBuilder Data, out UInt32 Length, out UInt32 RetC);
}
public static UInt32 Connect(string sessionID)
{
StringBuilder Data = new StringBuilder(4);
//Data will contain the ID code of Session
Data.Append(sessionID);
UInt32 rc=0;
UInt32 f=HA_CONNECT_PS; //function code
UInt32 l=4; //lenght of data parameter
return EhllapiFunc.hllapi(out f, Data, out l, out rc);
//return error code
}
In web api controller
public IHttpActionResult Index()
{
var connect= EhllapiClass.Connect("A");
return OK(connect);
}