Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Die Registrierung eines austauschbaren Terminals kann in die DllRegisterServer- Funktion der Komponente aufgerufen werden, die das Terminal implementiert. Das folgende Codebeispiel kann in den Code für DllRegisterServereingefügt werden.
ITPluggableTerminalClassRegistration* pTerminal;
BSTR bstrTerminalSuperclass = SysAllocString(L"{F7438990-D6EB-11d0-82A6-00AA00B5CA1B}");
// If (NULL == bstrTerminalSuperclass) process the error here.
BSTR bstrTerminalClass = SysAllocString(L"{AED6483E-3304-11d2-86F1-006008B0E5D2}");
// If (NULL == bstrTerminalClass) process the error here.
BSTR bstrTerminalCLSID = SysAllocString(L"{E2F7AEF7-4971-11D1-A671-006097C9A2E8}");
// If (NULL == bstrTerminalCLSID) process the error here.
HRESULT hr;
hr = CoCreateInstance(
CLSID_PluggableTerminalRegistration,
NULL,
CLSCTX_INPROC_SERVER,
IID_ITPluggableTerminalClassRegistration,
(void**)&pTerminal);
hr = pTerminal->put_TerminalClass( bstrTerminalClass );
// If (hr != S_OK) process the error here.
pTerminal->put_CLSID( bstrTerminalCLSID );
// If (hr != S_OK) process the error here.
pTerminal->put_Name( ... );
// If (hr != S_OK) process the error here.
pTerminal->put_Company( ... );
// If (hr != S_OK) process the error here.
pTerminal->put_Version( ... );
// If (hr != S_OK) process the error here.
pTerminal->put_Direction( ... );
// If (hr != S_OK) process the error here.
pTerminal->put_MediaTypes( ... );
// If (hr != S_OK) process the error here.
pTerminal->Add( bstrTerminalSuperclass );
// If (hr != S_OK) process the error here.
// Free the memory created by SysAllocString().
SysFreeString(bstrTerminalSuperclass);
SysFreeString(bstrTerminalClass);
SysFreeString(bstrTerminalCLSID);