PARAMETERS tcParameter CLEAR ALL CLOSE ALL * We maximize the window if it is not already maximized IF _screen.WindowState<>2 _screen.WindowState=2 ENDIF * We disable the close button _screen.Closable=.F. * DECLARE DLL statements for reading/writing to private INI files DECLARE INTEGER GetPrivateProfileString IN Win32API; String cSection,String cKey,String cDefault,String @cBuffer,; Integer nBufferSize, String cINIFile DECLARE INTEGER WritePrivateProfileString IN Win32API; String cSection,String cKey,String cValue,String cINIFile * DECLARE DLL statements for reading/writing to system registry DECLARE Integer RegOpenKeyEx IN Win32API; Integer nKey,String @cSubKey,Integer nReserved,; Integer nAccessMask,Integer @nResult DECLARE Integer RegQueryValueEx IN Win32API; Integer nKey,String cValueName,Integer nReserved,; Integer @nType,String @cBuffer,Integer @nBufferSize DECLARE Integer RegCloseKey IN Win32API ; Integer nKey * DECLARE DLL statement for Windows 3.1 API function GetProfileString DECLARE INTEGER GetProfileString IN Win32API; String cSection, String cKey, String cDefault,; String @cBuffer, Integer nBufferSize * DECLARE DLL statement to get the user logged into the network DECLARE INTEGER GetUserName in WIN32API String @,Integer @ * gaLangue Language field names in TABLE.DBF, TAG.DBF, etc. * gaLangueKey Key field in MESSAGE.DBF PUBLIC ARRAY gaLangue[2],gaLangueKey[2] gaLangue[1]='FRANCAIS' gaLangue[2]='ANGLAIS' gaLangueKey[1]='French' gaLangueKey[2]='English' * Only the Master class will set up the environment. So, in order to assure an ongoing open * of the Message.dbf table, we need to force SET EXCLUSIVE OFF at this level. LOCAL lcOldSetExclusive lcOldSetExclusive=SET('Exclusive') SET EXCLUSIVE OFF * Open the message table as we need it at this level USE GetIni('System','Data',CURDIR()+'Main.ini')+'\Data\Admin\Message' SET EXCLUSIVE &lcOldSetExclusive * Detection of another instance SEEK PADR('OPENIT',LEN(Message.Module))+PADR('SYSTEMNAME',LEN(Message.Cle)) ORDER ModCle IF CheckWin(ALLTRIM(Anglais)) MESSAGEBOX('You can only have one instance of this application in memory.',48,ALLTRIM(Anglais)) CANCEL ENDIF * Pour les rapports en landscape _ASCIICOLS=400 * Set the libraries DO CLASSLIB IN CUSTOM * Clear the screen CLEAR * Loading form Loading=CREATEOBJECT('About') Loading.SystemName.Caption=ALLTRIM(Anglais) SEEK PADR('OPENIT',LEN(Message.Module))+PADR('VERSION',LEN(Message.Cle)) ORDER ModCle Loading.Version.Caption=ALLTRIM(Anglais) Loading.NameIni='UPROPOS' USE IN Message Loading.Show() * This is a workaround to have the images being cached so the transparency of the GIF files will work * on buttons. LOCAL loImage,loImage2,loImage3,loImage4,loImage5,loImage6,loImage7 LOCAL loImage8,loImage9,loImage10,loImage11,loImage12,loImage13,loImage14 LOCAL loImage15,loImage16,loImage17,loImage18,loImage19,loImage20 LOCAL loImage21,loImage22,loImage23,loImage24,loImage25 loImage=CreateObject('Image') loImage.Picture='First.gif' loImage2=CreateObject('Image') loImage2.Picture='Next.gif' loImage3=CreateObject('Image') loImage3.Picture='Previous.gif' loImage4=CreateObject('Image') loImage4.Picture='Last.gif' loImage5=CreateObject('Image') loImage5.Picture='New.gif' loImage6=CreateObject('Image') loImage6.Picture='Open.gif' loImage7=CreateObject('Image') loImage7.Picture='Delete.gif' loImage8=CreateObject('Image') loImage8.Picture='Save.gif' loImage9=CreateObject('Image') loImage9.Picture='Undo.gif' loImage10=CreateObject('Image') loImage10.Picture='Close.gif' loImage11=CreateObject('Image') loImage11.Picture='FirstDisable.gif' loImage12=CreateObject('Image') loImage12.Picture='NextDisable.gif'After this, if I put a return, the application will simply terminate. This is working fine. If the return is there, I can build as many times I wish, run the app and build again.
loImage13=CreateObject('Image') loImage13.Picture='PreviousDisable.gif'and have a return after, I will not be able to build another time and the VFP interface will simply freeze. I have to kill the application and start VFP again.