Verastream SDK for Airlines
Microsoft Foundation Classes (MFC) Sample Code

The MFC Events sample application demonstrates how to connect to the host using COM objects under MFC and how to receive events from screen objects.

This sample is located in <Installation Location>\samples\MFC\Events. If you did not install the VSDK COM/.NET Support option, this sample application is unavailable.

To run this sample, you must modify the embedded XML configuration in the CEventsDlg::OnRequestScreen method with the host name and terminal ID.

For UTS, you need to modify the Int1 configuration parameters (Tsap, AppName, InetAddress, and TerminalId) to match the host. The Int1 XML configuration parameters are documented in Requesting a UTS INT-1 Screen Object.

The code you will need to modify is shown below:

Embedded XML Configuration
Copy Code
void CEventsDlg::OnRequestScreen()
{
    CoInitializeEx(NULL,COINIT_APARTMENTTHREADED);
    // Setup the configuration XML
    CString csHostname = "YOURHOST";        // ** Replace with the DNS name or IP address of your host
    CString csTerminalId = "YOURID";        // ** Replace with your terminal ID
    CString csEnvironmentName = "UDSSRC";
    CString csEnvironmentXML = "<Int1 AppName=&quot;" + csEnvironmentName + "&quot; InitTrans=&quot;&quot;>\n<tp0 Tsap=&quot;TIPCSU&quot; InetAddress=&quot;" + csHostname + "&quot;/>\n</Int1>";
    CString csEnvironmentMapperXML = "<Int1 AppName=&quot;UDSSRC&quot; InitTrans=&quot;^&quot;>\n<tp0 Tsap=&quot;TIPCSU&quot; InetAddress=&quot;" + csHostname + "&quot;/>\n</Int1>";
    CString csConfig = "<ScreenUts>\n";
            csConfig +="\t<Int1Interface TerminalId=\"" + csTerminalId + "\" EnvironmentName=\"" + csEnvironmentName + "\" AutoConnect=\"true\">\n" +
                       "\t\t<EnvironmentData Name=\"" + csEnvironmentName + "\" XMLData=\"" + csEnvironmentXML + "\" />" +
                       "\t\t<EnvironmentData Name=\"" + "MAPPER"          + "\" XMLData=\"" + csEnvironmentMapperXML + "\" />\n" +
                       "\t</Int1Interface>\n" +
                       "</ScreenUts>";
......

 

For more information on creating XML configurations, see Defining an XML Configuration.

 

Related Topics
ActiveX Technologies Supported
Development Tools Supported