I read about Reset function. I'm sorry, but I think it's no a good idea this style and I think there are other problems.
Only one WND_MAIN must exists, but with HMG4 I can start with a Modal (see below).
Please take a look to this
Code: Select all
IF ::nType == WND_MAIN // Main
// Initialization
::s_qApp := QApplication()
Resource():New()
PUBLIC __cActiveWindow := ''
ENDIF
This was my previous code that I must rewrite and now I use a Modal Window before MainForm. I'm sorry it's a pseudo-code
Code: Select all
FUNCTION Main()
....
ShowMainForm()
RETURN NIL
FUNCTION ShowMainForm()
....
WITH OBJECT MainForm....
:OnInit := {|| OnInit() }
....
FUNCTION OnInit()
lGranted := ShowLogin()
IF lGranted == .F.
MainForm:Release() <=== this create problem
....
FUNCTION ShowLogin()
WITH OBJECT LoginForm
......
Please take a look to this code (window.prg evolution) and check it with zipped files.
Attention: it's an example extracted (it's real but not tested) from my little HMG, that I use to do test
Code: Select all
CLASS WINDOW FROM BASIC
........
METHOD New() CLASS WINDOW
IF ::s_qStarted == .F.
HMGQT():Start()
ENDIF
........
METHOD Create CLASS Window
........
// IF Window is The Main Window Then Create Application
IF ::nType == WND_MAIN // Main
PUBLIC __cActiveWindow := ''
ENDIF
........
ie
Code: Select all
FUNCTION Main( hb_aparams )
PUBLIC oHmgQt := HMGQT():Start( hb_aparams ) <== this is not HMG3 but a HMG4 evolution.
......
I'm at your disposal.
Best regards