BEA Logo BEA Tuxedo Release 8.0

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   Tuxedo Documentation   |   Programming BEA Tuxedo ATMI Applications Using TxRPC   |   Local Topics   |   Previous Topic   |   Next Topic   |   Contents

 


Building a Windows Workstation RPC Client

Compilation of the client stub for Windows requires the -D_TM_WIN definition as a compilation option. This ensures that the correct function prototypes for the TxRPC and BEA Tuxedo ATMI run time functions are used. While the client stub source is the same, it must be compiled specially to handle the fact that the text and data segments for the DLL will be different from the code calling it. The header file and stub are automatically generated to allow for the declarations to be changed easily, using C preprocessor definitions. The definition _TMF (for "far") appears before all pointers in the header file and _TMF is automatically defined as "_far" if _TM_WIN is defined.

In most cases, using standard libraries, the buildclient(1) command can be used to link the client. The library to be used is wtrpc.lib.

The sample also shows how to create a Dynamic Link Library (DLL) using the client stub. This usage will be very popular when used with a visual application builder that requires DLL use (where the application code cannot be statically linked in). Windows functions are traditionally declared to have the _pascal calling convention. The header file and stub are automatically generated to allow for the declarations to be changed easily, using C preprocessor definitions. _TMX (for "eXport") appears before all declared functions. By default, this definition is defined to nothing. When compiling a stub for inclusion in a DLL, _TMX should be defined to _far _pascal. Also, the files to be included in the DLL must be compiled with the large memory model. Because using _pascal automatically converts the function names to uppercase in the library, it is a good idea to run with the -port case option turned on, which does additional validation to see if two declared names differ only in case.

A complete example of building a Windows DLL is shown in Appendix A, "A Sample Application."

Note: A compilation error may occur if a TxRPC client includes windows.h, due to a duplicate uuid_t definition. It will be necessary for the application to either not include windows.h (because it is included already) or to include it within a different file in the application.

 

back to top previous page next page