Windows Platform Notes


This section covers any special notes pertaining to Windows platforms. Also check the README file shipped with the product. The README file contains the most current information for the product, and may contain information on platforms not covered in this book or information that is more current for your platform.

TIBCO SmartSockets Visual C++ Libraries

Library Naming Convention

The SmartSockets 32-bit Windows (Win32) and 64-bit Windows (Win64) libraries use this naming convention:

namex.lib 

where:

name
indicates the library module name.
x
is either 'd' to indicate a debug library, or omitted to indicate and optimized library

Libraries with debug information use the debug CRT provided with Microsoft Visual C++.

The DLLs incorporate a release compatibility version number as part of the name. The SmartSockets Software Release 6.8 and all binary-compatible releases have DLLs named name50x.dll (for 32-bit DLLs) or name64x.dll (for 64-bit DLLs).

The Libraries Directory

The subdirectory lib\i86_w32 contains the SmartSockets Win32 libraries:

File
Link Type
Description
C Runtime
tipc.lib
Dynamic
IPC Library
Multithread DLL
tipcd.lib
Dynamic
IPC Library
Debug Multithread DLL
tipcx.lib
Dynamic
Legacy C++ Library
Multithread DLL
tipcxd.lib
Dynamic
Legacy C++ Library
Debug Multithread DLL
tsscpp.lib
Dynamic
New C++ Library
Multithread DLL
tsscppd.lib
Dynamic
New C++ Library
Debug Multithread DLL
tutil.lib
Dynamic
Utility Library
Multithread DLL
tutild.lib
Dynamic
Utility Library
Debug Multithread DLL

The new C++ libraries, tsscpp, support multiple RTserver connections, and include many other changes. They are not source-compatible and do require code changes. Choose which C++ libraries you want to link to, either the current set or the legacy set.

Windows-Specific Features

Function Calling Conventions under Win32

SmartSockets Version 5.x and higher Win32 DLLs use the __stdcall calling convention. This is a change from Version 4.0 DLLs, which used the __cdecl calling convention. The switch was made because, as can be inferred from the name, __stdcall is the standard calling convention for DLLs under Win32. Using the standard calling convention confers the advantage that functions in SmartSockets Version 6.8 DLLs can be called from languages other than C, for example, Visual Basic or PowerBuilder.

Recompiling existing SmartSockets code for the new release may result in compile-time errors if the T_ENTRY declaration specifier was omitted from callback functions and thread entry routines. The correct way to fix this error is to add T_ENTRY to the declaration specifiers of the function. Do not simply cast the offending function pointer reference to the correct type. This eliminates the compile-time error but the generated code is not correct, and your program can fail in mysterious and hard-to-diagnose ways. If T_ENTRY was used, no source-level changes should be required.

Omitting T_ENTRY was tolerated with the SmartSockets Version 4.0 libraries because T_ENTRY was defined to __cdecl, which was the compiler default. With SmartSockets Version 5.x and higher, T_ENTRY is defined to __stdcall, and omitting it will cause a compile-time error.

Windows Registry

SmartSockets requires that certain configuration information be made available to the runtime libraries through the process environment. On UNIX platforms, this is typically accomplished by requiring SmartSockets users to manually add the information in their account profiles. While this same approach also works with the Win32 version of SmartSockets, this version has been extended to also allow the information to be extracted from the Windows registry.

The SmartSockets installation program creates this registry key when SmartSockets is installed on a Windows machine:

HKLM\SOFTWARE\TIBCO Software Inc.\SmartSockets\6.8.0\Environment 

HKLM is a commonly used acronym for HKEY_LOCAL_MACHINE.

Registry values added to this key are seen by the SmartSockets runtime libraries just as if they had been added to the environment settings on Windows NT, 2000, or XP. Real environment variables can override the fallback settings provided in the registry.

The advantage of using the registry for this information is that it does not require editing individual account profiles or modifying the system profile using administrator privileges.

Command Prompt

The SmartSockets Command Prompt is provided as a convenience, in case you want to interact with SmartSockets using a console prompt. When selected, it starts a command interpreter with its current directory set to the SmartSockets installation directory and it automatically executes ssvars32.bat to set the interpreter's RTHOME, RTARCH, PATH, INCLUDE and LIB environment variables.

When the tutorial lessons tell you to complete a sequence of steps by typing commands into a command prompt, this is the simplest way to get a properly configured command interpreter. Advanced users who find themselves accessing the command prompt frequently can modify their environment settings to incorporate the environment variables from ssvars32.bat. For more information, see Path Settings.

You can invoke the SmartSockets Command Prompt at any time by selecting Programs > SmartSockets > Command Prompt from the Start menu.

Redirecting Program Output

SmartSockets provides a number of text output functions such as TutOut and TutWarning. When your program needs to output text, you can use one of these SmartSockets functions. This makes your text output portable to all the SmartSockets platforms.

These functions are designed for simple printf-style console output. However, most Windows applications have no stdout or stderr for use with printf. The SmartSockets Windows platform provides an alternative using TutWinSetOutputListBox. This function is passed the HWND of a list box control. It manages all text output by placing it in the provided list box. In addition, you can specify the number of window buffer lines to be maintained.

Creating a Project With Visual C++ Developer Studio 6.0

The first time you use SmartSockets with Visual C++, add the SmartSockets directories to the default search directories. This allows the SmartSockets headers and libraries to be found without requiring full path names. Follow these steps from within Developer Studio to add the SmartSockets directories to the default search directories:

  1. Select Tools > Options.
  1. Select the Directories Tab.
  2. Choose Show directories for: Include files.
  3. Add your SmartSockets include directory to the list:
  4. C:\Program Files\Tibco\ss68\include

  5. Choose Show directories for: Library files.
  6. Add your SmartSockets library directory to the list:
  7. C:\Program Files\Tibco\ss68\lib\i86_w32

  8. Click OK.

Project Settings

Create a new project using File > New Project. Choose the project name, type and directory. Once the project is created, display the Project Settings dialog box. For more information, see the Visual C++ documentation.

Note the presence of multiple targets in the Settings For portion of the Project Settings dialog box.

Highlight only the Debug target and make these setting changes:

Dialog Tab
Category
Section
Setting
Notes
C/C++
Preprocessor
Preprocessor Definitions
  • WIN32
  • _DEBUG
  • _WINDOWS
Use additional appropriate defines for your project type.
 
Code Generation
Use Run-Time Library
  • Debug Multithreaded DLL, or
  • Debug Multithreaded
Use the appropriate setting for your choice of libraries.
Link
General
Object/Library Modules
  • tutild.lib
  • tipcd.lib
 

Go back and highlight only the Release target and make these setting changes:

Dialog Tab
Category
Section
Setting
Notes
C/C++
Preprocessor
Preprocessor Definitions
  • WIN32
  • NDEBUG
  • _WINDOWS
Use additional appropriate defines for your project type.
 
Code Generation
Use Run-Time Library
  • Multithreaded DLL, or
  • Multithreaded
Use the appropriate setting for your choice of libraries.
Link
General
Object/Library Modules
  • tutil.lib
  • tipc.lib
 


TIBCO SmartSockets™ Installation Guide
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com