ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / User Groupware functions
  • How to use the gpwOpen function?
  • Pre-launched sessions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
gpwOpen (Function)
In french: gpwOuvre
AjaxNot available
ODBCOLE DBNot available with these kinds of connection
Opens the User Groupware login window or page.
Note This function is only required if User Groupware has been integrated with the "Manual launch" option. If the option "Automatic start" has been selected, this function is ignored.
Example
// Ouvre la fenêtre de login du groupware utilisateur
nRes is int = gpwOpen("c:\GpwUtilisateur")
// Si le login a échoué 
IF nRes <> gpwOk THEN 
	SWITCH nRes 
		CASE gpwCancel : Info("Vous avez cliqué sur le bouton Annuler.")
		CASE gpwError : Error("Erreur à l'initialisation du groupware.")
		CASE gpwUnknownUser : Error("Utilisateur inconnu.")
		CASE gpwInvalidPassword : Error("Mot de passe invalide.")
	END 
	EndProgram()
END 
// Récupération du prénom de l'utilisateur 
Prénom is string = gpwGetUserInfo(gpwInfoFirstName)
Info("Bienvenue" + Prénom)
Syntax
AndroidiPhone/iPad

Specific syntax for Android and iOS applications Hide the details

gpwOpen(<WLanguage procedure> [, <User database>])
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback") called when the login window is closed.
This procedure has the following format:
PROCEDURE <Procedure name>(<Connection> is boolean)
The <Connection> is a boolean:
  • True if the user is logged in,
  • False if the user is not logged in.
<User database>: Integer constant
Database of users and rights to use:
gpwDatabaseDefaultThe database of users and rights depends on the application start mode:
  • if the application is launched in test mode (via the simulator or directly on the device with WMDev), the test database will be used.
  • if the application is launched from the version deployed on the mobile device, or an Android emulator, the production database will be used.
gpwDatabaseProductionForces the use of the production database regardless of the application start mode.
gpwDatabaseTestForces the use of the test database regardless of the application start mode.
Remarks

How to use the gpwOpen function?

gpwOpen allows you to define the User Groupware startup mode. This allows you to perform a number of actions before launching the User Groupware connection window or page: execute code, launch windows or pages, etc.
An example of how this function can be used: in a multilingual application using User Groupware, the first window/page of the application lets you choose the language in which the application will run. When creating the application, you must:
  • choose not to automatically start the User Groupware when it is integrated
  • open the window or page for language selection as first application window, then call the login window or page with gpwOpen.
AndroidiPhone/iPad If the User Groupware is enabled in "Manual start" mode, the following operations must be performed:
  • Do not define a first project window.
  • Call gpwOpen in the "Initialization" event of the project.
  • Open the first project window from the WLanguage code of the procedure passed as a parameter to gpwOpen.

Pre-launched sessions

If your project uses pre-launched sessions, this function must not be used in the project initialization event. This function must be used in the "Initialization in pre-launched session mode" event.
Business / UI classification: Neutral code
Component: wd300gpu.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Exemplo de uso do comando gpwOpen()
//Conexao
ok, ok1, ok2, ok3 is boolean

myConn is Connection
myConn..Provider = hNativeAccessSQLServer
myConn..User = "adriano"
myConn..Password = "adriano@2016"
myConn..Source = "192.168.0.162\projeto01"
myConn..Database = "projeto01"
myConn..Access = hOReadWrite

ok1 = HOpenConnection(myConn)
IF ok1 = False THEN
Info(ErrorOccurred() +" - "+ HErrorInfo())
END


IF gpwInitAnalysis() = False THEN
Error(ErrorInfo())
ok2 = False
ELSE

ok2 = True
IF gpwOpen() = gpwOk
ok3 = True
ELSE
Info(ErrorOccurred() +" - "+ HErrorInfo())
ok3 = False
END

END

NextTitle("Atenção")

IF ok1 = True AND ok2 = True AND ok3 = True THEN //deve dar tudo ok

Info("Conectou com sucesso no banco de dados!")

ELSE

Info("Falha ao tentar conectar no Servidor")

END
BOLLER
28 Nov. 2016

Last update: 03/27/2025

Send a report | Local help