![]() Sample Visual C++ Application Using OCX (Fragment) |
![]() DEVELOPER |
![]() |
void CP4_CPP2Dlg::OnButton1()
{
CString s;
m_Machine.GetWindowText(s);
m_System.SetMachine (s);
m_System.SetPort(0);
m_System.SetEnvironment("env");
m_SystemUserId.GetWindowText(s);
m_System.SetSystemUserId(s);
m_SystemPassword.GetWindowText(s);
m_System.SetSystemPassword(s);
int res = m_System.Login();
///task: pc-remote:TK_FILDIR "/user:XUser:XPWD" /oper:OPERID:OPERPWD /codiv:MDC /env:env%1 %2 %3
m_Session.SetSystemHandle(m_System.GetSystemHandle());
m_Session.SetEnvironment("env");
m_OperatorId.GetWindowText (s);
m_Session.SetOperatorId(s);
m_OperatorPassword.GetWindowText(s);
m_Session.SetOperatorPassword(s);
m_CoDiv.GetWindowText (s);
m_Session.SetCoDiv(s);
res = m_Session.Open();
m_Session.SetParamList("");
m_Session.SetParamListCount(0);
m_Session.SetEnablePrinterEvents(true);
m_TaskName.GetWindowText(s);
m_Session.SetTaskName(s);
boolean bres = m_Session.ExecTask();
res = m_System.GetLastError();
m_Session.SetEnablePrinterEvents(false);
m_Session.Close();
m_System.Close();
}
void CP4_CPP2Dlg::OnPrintLineApip4sessionctrl1(long nSessionHandle, long nOutputFormat, long nType, long nLineCtrl, long nDataLen, LPCTSTR pOutBuf)
{
CString sText;
m_Output.GetWindowText(sText);
CString sText2 = CString(pOutBuf, nDataLen);
sText += sText2;
m_Output.SetWindowText (sText);
}
Topic ID: 540133