Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MDI window Error

Status
Not open for further replies.

SalehKiswani

IS-IT--Management
Jul 16, 2011
60
Hi
I have an old application depending on Menu Bar, now I changed the menu bar items to buttons, the problem that when I call any screen I get MDI window error, before when I had this problem I used to unflag the MDI checkbox in the called window and it is ok, but this application had more than 90 procdures and it is hard to change them all.

any suggessions is highly appreciated.

Thank you
 
Hi!

That's because you have NOT TICKED the "Initiate Thread" option. Windows with the MDI Child attribute MUST be opened in a separate thread from the Frame.

Regards
 
Hello ,
Actually I created a template to create the screen buttons for me.

the code part is:
! tried first time
Code:
      CASE ACCEPTED()
           OF %Control
              START(%ButtonProcedure, 25000)

! tried second time
Code:
      CASE ACCEPTED()
           OF %Control
              %ButtonProcedure()


but both have the same result with the same error.

thank you

 
Hi!

You mean buttons from Menu Items ???

The template is incorrect - it should be ::

#AT.....

CASE ACCEPTED()
#FOR(%Control),WHERE(%ControlType='BUTTON')
OF %Control
START(%ButtonProcedure, 25000)
#ENDFOR
END

#ENDAT

Post your full template code for a more apt reply/correction.

Regards
 
I know my dear and my full template is working fine (thaks to your answer in my other thread), I didnt write the full tempalte here beecause it is long that it contains defining the screen and running it,I just wrote the part which concerns the calling of the procedure.
the new screen buttons respond to the press and call the procedure ,but in all cases Iam getting "unable to open MDI window....".
whe I go to the called procedure and reset the MDI flag , it works fine , but this application had more than 90 procdures and it is hard to change them all.

Thsnk you again
 
Hi!

the new screen buttons respond to the press and call the procedure ,but in all cases Iam getting "unable to open MDI window....".

And the generated code in the frame is START(MyProc, 25000) ???

And is the main window of the procedure the FIRST window to be opened in the procedure ???

If yes to both - very weird !!!

Regards
 
Thank you Shanker, everything is clear now and I knew what was the problem.
My template creates a screen that is called by a button in the frame (just for testing).

now I separated that window and put it as first procedure in the application and everything is fine.

Thank you so much for the explanation.

Regards
 
Dear Shanker,
Sorry I complecated the issue to much.

My case is simple if you can help me:

My apllication starts with Frame. I want now to start it with a Normal window with buttons instead of the menu bar.

Now my Screen is ready with all buttons and their procedure calls but the remaining problem is the MDI error . and I dont want to change remove MDI flag from all procedures because they are so many.

THank you in advance
 
Hi!

Let's assume that the MENU procedure is a standard Window procedure called MainMenu which has buttons to load the procedures. If these buttons are defined at design time, it is straight forward to use the template prompt to call a procedure with the "Initiate Thread" ticked. If you are using some template to create the Buttons, then you need to make sure the template generates the START(...) command line to load the procedure. ONCE A START IS CALLED, THE FIRST AND MAIN WINDOWS USED IN THAT PROCEDURE MUST BE A MDI CHILD WINDOW. If you are calling another window AFTER loading the main window, that window may be MDI or not although it is ideal that all windows are set as MDI Child unless you have good enough reason for not doing so.

If the above does not clarify the issue for you to solve the problem, you need to send me the generated source for the Menu procedure and the Called procedure to help you further. My e-mail is - j s h a n k a r AT e i m DOT a e.

Regards
 
Thank you for the help Shankar,
I think it is better to export to TXA file and reset the MDI flag and Import it again to obtain the exact idea I need .

Thank you again

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top