Can somebody help me on how to start form B from a button in form A ?
I use the following from the DoubleClick event of an UltraGrid. I would think it would be the same from a button click event.
DEFINE VARIABLE rChildForm AS DeptMaint NO-UNDO.
rChildForm = NEW DeptMaint().
rChildForm:WindowState = System.Windows.Forms.FormWindowState:Maximized.
rChildForm:Show().
It says "debtMaint was not found"...
debtMaint needs to be the class name of the 2nd Form you try to open.
What's the filename of the second form?
The second form is ImportDef.cls which is in the project PrijslijstImport
As first form I have a procedure now (to test it):
DEFINE VARIABLE rChildForm AS ImportDef NO-UNDO.
rChildForm = NEW ImportDef().
rChildForm:WindowState = System.Windows.Forms.FormWindowState:Maximized.
rChildForm:Show().
Mike ir correct. The deptMaint was the name of my class. you have to substiture your class name.
I figured that out already. And i did as you can see. But stil ImportDef not found...
It may be a propath issue if it is in a different project. You can adjust your propath to include a different project.
It' all in the propath of the project: i even did add the external dir to the propath.
but i see that it is a propath issue.
Putting this statemant at first the error is gone:
PROPATH = PROPATH + ",d:\DLC102\PrijslijstImport".
Very Strange !!!
in the run configuration, additional startup parameters, i used -basekey INI -ininame. In this ini there is a propath setting. Deleting this startup parameter it works.
Does this parameter override the propath setting from the run configuartion ??
Solved the propath issue.
Now the next thing. My code:
DEFINE VARIABLE rChildForm AS ImportDef NO-UNDO.
rChildForm = NEW ImportDef().
rChildForm:WindowState = System.Windows.Forms.FormWindowState:Maximized.
rChildForm:Show().
Shows the ImportDef for just a second and then it's gone again.
Can you help me with this?
You need a wait for, exactly one wait for. In your original inquiry you said you already had a form running and wanted to start a second one from a button, that would indicate you already had a wait for.
I run the following code in my startup procedure to load my MainMenu and then WAIt-FOR it to exit. I can then open other windows, enter data and then exit.
DO ON ERROR UNDO, LEAVE
ON ENDKEY UNDO, LEAVE
ON STOP UNDO, LEAVE
ON QUIT UNDO, LEAVE:
rUnifyHOST = NEW MainMenu( ) .
WAIT-FOR Application:Run(rUnifyHOST).
END.
i have started or old application in 10.2 beta. It works.
I took an old screen which is started from the application-menu and added a button to it:
ON CHOOSE OF butOE102 IN FRAME Brws-Frame /* RUN OE10.2 prog */
DO:
MESSAGE "1".
DEFINE VARIABLE rChildForm AS ImportDef NO-UNDO.
MESSAGE "2".
PROPATH = PROPATH + ",d:\DLC102\PrijslijstImport".
MESSAGE "3".
rChildForm = NEW ImportDef().
MESSAGE "4".
rChildForm:WindowState = System.Windows.Forms.FormWindowState:Maximized.
MESSAGE "5".
rChildForm:Show().
MESSAGE "6".
It stops after message 3.
What am i missing here?
Hi Maurice,
Ignore my response ... I see you have identified it as a PROPATH issue!!
Regards,
M
thank you for your help so far.
Did you see my last (new) problem, too?
Does the form work when you start it straight from the visual designer? It sounds like there's a problem in the constructor.
yes, the forms works when running form the designer !
Have you tried creating and running a blank form?
If this works then I would take a backup of the form you are having a problem with and start stripping/commenting out the code. It can take a while, but I'm sure you'll identify the problem.
it hangs on:
rChildForm = NEW ImportDef().
I was wondering if you created a new form with nothing on it and then created and showed that instead, whether that worked.
In addition to this have you tried putting messages in the Form constructor to see if this gets called?
nope two times:
- the empty form does not load also
- the contructor does not get pass teh super() (which has to be the first statement)
Take youre time. I won't be back on this untill next week...
The second form is ImportDef.cls which is in the
project PrijslijstImport
As first form I have a procedure now (to test it):
DEFINE VARIABLE rChildForm AS ImportDef NO-UNDO.
rChildForm = NEW ImportDef().
rChildForm:WindowState =
System.Windows.Forms.FormWindowState:Maximized.
rChildForm:Show().
Maurice,
Have you tried (instead of fixing the PROPATH):
DEFINE VARIABLE rChildForm AS PrijslijstImport.ImportDef NO-UNDO.
rChildForm = NEW PrijslijstImport.ImportDef().
rChildForm:WindowState = System.Windows.Forms.FormWindowState:Maximized.
rChildForm:Show().
-peter
On
DEFINE VARIABLE rChildForm AS PrijslijstImport.ImportDef NO-UNDO.
i get the compile error:
Invalid datatype specified: PrijslijstImport.ImportDef. Specify a datatype such as 'character' or the name of a class. (5638)
??
I think this means that the PrijslijstImport directory is not in the PROPATH
it is in the propath of the project. But i still get the compilation error....
You would not want PrijslijstImport in the PROPATH if PrijslijstImport is a package name You would want its parent directory in the PROPATH.
yeah, that's what I meant !!
* jmls blushes
The problem seems to be in finding the project/class/package or something.
From one form within the project to another form within the project it works.
But calling a form (from the project) form a cmplete other window wich has no reference to the project (our old application) it doe not work...
Message was edited by:
Maurice Stassen
Perhaps you have a conflict with database name or table.
I recall i had an issue like that becuase i gave my package the same name as the database. When i renamed my package structure the problems were gone.
Message was edited by:
John Kattestaart
In the new beta drop it works a bit better.
The screen is actually build en shown !
But then i get:
rsion 6 database. (1033) error
?? Any idea ??
and after that i get:
Run-time error in WAIT-FOR at line 3717 (relative to expanded source) of mainProcedure (3269)