![]() |
How to load the stored application window directly from the programHow to load the stored application window directly from the programYou can load the stored application window with following funtions.
The following shows to load the stored application window directly from the program. #include "WSCconductor.h" ... WSCbase* window = NULL; //for returned value: char* field = "FILE"; //from FILE. char* fname = "newpic001.oof"; //FILE name. char* path = "/usr1/win/data"; //specify the directory. //Specify the directory. WSGIconductor()->setSerializePath(path); //Loading of the stored application window. long ret = WSGFloadWindow(field,fname,&window,NULL); if (ret == WS_NO_ERR){ //success window->setVisible(True); //display the window. }Specify the storing attributes for the "field". The store function supports "FILE" now. In the future,it will support a RDB, an interprocess communication,a networking field, and so on... Specify the directory for the "path" to the conductor which controls the storing function. The default value is the current directory. Specify the file name for the "fname".and you can load the stored application window with WSGFloadWindow(). WSGFloadWindow() creates the instances when if it succeeds, so if you call it several times,it creates several instances. Please check the directory,the file name,the permission of the specified file,if it fails. How to load the stored partial application window directly from the programThe following shows to load the stored partial application window.#include "WSCconductor.h" ... WSCbase* window = NULL; //for returned value: WSCbase* parent = newwin000; //the parent instance for //the partial application window. char* field = "FILE"; //from FILE. char* fname = "newpic001.oof"; //FILE name. char* path = "/usr1/win/data"; //specify the directory. //Specify the directory. WSGIconductor()->setSerializePath(path); //Loading of the stored partial application window. long ret = WSGFloadWindow(field,fname,&window,parent); if (ret == WS_NO_ERR){ //success window->setVisible(True); //display the window. }It is same as the loading of the stored application window fundamentally, but it requires the parent instance in this case, for the partial aplication window, because it is not a window and needs a parent window to display. You can specify the parent window like, WSCwindow, WSCform,WSCscrForm which has the management function of child instances. Document Release 3.0 For Use with Wide Studio Release 3.0, Summer 2002
|