| Hyderabad Jobs | Book Website | ![]() |
I Love Hyderabad | Hyderabad Colleges |
| Home | Business Emails | Hyderabad Classifieds | Contact Us | |
| 7 Wonders of Hyderabad | Web Hosting | Yellow Pages | Our Network | |
Mastering PowerBuilder
Building the Server ApplicationIf you haven't created a library for the server application, create a library product-server.pbl and create an application pms in this library. Then copy all the DataWindows from the product.pbl into this library. This is needed because, we are using DataStores on the server. Then copy the user object ncst_product_master—you don't have to copy proxy object. Create a window w_pms_server as shown below. Name CommandButtons as cb_start_or_stop_server, cb_server_options, cb_refresh and cb_exit respectively from left to right. Below is a DataWindow dw_users. There is another DataWindow dw_options right behind the dw_users.
Paint a tabular/Grid presentation style, external data source DataWindow d_users with the following structure
Paint a FreeForm presentation style, external data source DataWindow d_server_options with the following structure.
To make the server to listen to the clients, we need to do four things.
First let's define registry entries and set them with proper default values. Select Start > Run menu option from the taskbar and run REGEDIT command and define HKEY_LOCAL_MACHINE\SOFTWARE\PMS key in the registry. Then create the following sub-keys and populate them as shown below:
Declare the following instance variables.
Declare a global transport object. The reason we are declaring it as a global is, we need it through out the server application.
Let us create the transport object in the w_pms_server window's open event.
We will be defining four functions. of_SetTransportObjectValues – Reads values from registry and sets the transport object. of_Disconnect—Disconnects the specified client from the server. of_GetServerOptions()—Reads server options and loads into the DataWindow. of_SetServerOptions()—Reads the server options from the DataWindow and saves in the registry. Declare of_SetTransportObjectValues() function at w_pms_server as shown below.
In the above function, we are reading the registry entries and loading into the global transport object variable.
|
| Copyright © 1996 - 2006 HamaraShehar.com Pvt. Ltd. All Rights Reserved.
Domain Registration, Website Design, Website Hosting by HamaraShehar.com |