07.07.2015 Views

COM/MTS Guide - Prolifics

COM/MTS Guide - Prolifics

COM/MTS Guide - Prolifics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Sample Client Screensid = sm_obj_create("cCustomers")}On exiting the screen, the <strong>COM</strong> component is destroyed.proc exit{call sm_obj_delete_id(id)}This JPL procedure calls the <strong>COM</strong> component's GetCustomer method and gets thevalue of the RowCount property:proc do_search{vars errorCompanyName[1] = searcherror = sm_obj_call (id, "GetCustomer", \CompanyName, CustomerID, Phone)rowcount = sm_obj_get_property (id, "RowCount")}The Panther <strong>COM</strong> Gallery includes this sample in addition to other <strong>COM</strong> componentsand client screens. To view these samples, openPantherInstallDir\samples\com\comsamples.lib in the Panther editor.Writing a Java Event HandlerTo implement the processing for the sample screen in Java, a screen event handlerinstantiates and destroys the <strong>COM</strong> component. The client screen calling this eventhandler has a Java Tag of ClientScreen.import com.prolifics.jni.*;public class ClientScreen extends ScreenHandlerAdapter{public void screenEntry(ScreenInterface s, int context){FieldInterface id = s.getField("id");FieldInterface id1=s.getField("id1");CFunctionsInterface cFuncs = s.getCFunctions();ApplicationInterface appface=s.getApplication();ScreenInterface tscr=appface.getScreen();int a=appface.set_int4-8 Building Client Screens

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!