![](http://s1.manualzz.com/store/data/004193035_1-0bd3c37c086a1c37e45a6e40d2012912-128x128.png)
advertisement
![User Manual HTS Hengstler Terminal Server for Windows | Manualzz User Manual HTS Hengstler Terminal Server for Windows | Manualzz](http://s1.manualzz.com/store/data/004193035_1-0bd3c37c086a1c37e45a6e40d2012912-360x466.png)
{
CString result; static BYTE parms[] =
VTS_I4 VTS_I4;
InvokeHelper(0x5, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms,
File, Number); return result;
}
CString HengstlerTerminalServer::WriteFile(long File, long Number, LPCTSTR Value)
{
CString result; static BYTE parms[] =
VTS_I4 VTS_I4 VTS_BSTR;
InvokeHelper(0x6, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms,
File, Number, Value); return result;
}
hconnect.cpp:
// This example is taken from the Microsoft example CALCDRIV
// and has been modified for use with Hengstler Terminal Server
BOOL CDriverDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// create the hts object that we'll drive through OLE automation
COleException e;
CLSID clsid; if (CLSIDFromProgID(OLESTR("Hengstler.TerminalServer.10"), &clsid) !=
NOERROR)
{
AfxMessageBox(IDP_UNABLE_TO_CREATE);
EndDialog(IDABORT); return FALSE;
}
// try to get the active hts before creating a new one
LPUNKNOWN lpUnk;
LPDISPATCH lpDispatch; if (GetActiveObject(clsid, NULL, &lpUnk) == NOERROR)
{
HRESULT hr = lpUnk->QueryInterface(IID_IDispatch,
(LPVOID*)&lpDispatch); lpUnk->Release(); if (hr == NOERROR) m_hts.AttachDispatch(lpDispatch, TRUE);
}
// if not dispatch ptr attached yet, need to create one if (m_hts.m_lpDispatch == NULL &&
!m_hts.CreateDispatch(clsid, &e))
{
AfxMessageBox(IDP_UNABLE_TO_CREATE);
EndDialog(IDABORT); return FALSE;
}
// read a counter register to test and see if it works
CString result = m_hts.ReadRegister(1,1);
// examine result in the debugger return TRUE; // return TRUE unless you set the focus to a control
}
Tuning
In order to suppress the overhead inside HTS which occurs during open device and close device operations upon each DDE or OLE request a trick can be applied. Append the following lines to the file hentmsrv.ini
(after terminating HTS):
hentmsrv.ini:
[MultiTasking]
DirectAccess=1
This modification should only be carried out if HTS is used exclusively by one application. Please watch the case of the letters.
HTS for Windows page 25
advertisement
Related manuals
advertisement
Table of contents
- 4 Introduction
- 4 Tasks of HTS
- 5 Compatibility Issues
- 5 Topology
- 6 Installation
- 6 System requirements
- 6 Setup
- 7 Autostart
- 8 Startup
- 9 Primary Startup
- 10 Setup - Driver Settings
- 12 System Topology
- 13 Point-to-point (S), (S1)
- 13 Several Counters via RTC to the PC (N), (N1)
- 14 Terminal Class Definitions
- 16 Terminal Configurations
- 17 Starting HTS
- 19 Integration into Customer Application
- 19 Communication Mechanism
- 19 Schematical Overview: Server Communication
- 19 Command Structure
- 20 Data Exchange with Counters
- 22 Excel and Visual Basic
- 23 C++ Applications
- 25 Tuning
- 26 Diagnostics and Error Handling
- 26 Settings Overview
- 26 hentmsrv.ini
- 26 vt3tm.ini
- 27 vt3c0000.ini
- 27 vt3c0005.ini
- 29 Statistics
- 30 Line Monitor
- 31 Modem Operation
- 31 Connection Setup
- 31 Connection Termination