Open several forms (dialogs)

  • Hi,


    I have a graphic application that can open several forms (dialogs) at the same time. In this moment whe I try to close the dialogs the system close the form and open the same form again ¿?...


    I adjusted the program memory but the problem was not fixed.


    Any idea ? We need more memory ?


    Oscar

  • Hello,
    i do not think that low memory causes this effect. Can you give accurate information about the memory in use?
    Which tool do you use for development?
    Can you also give detailed information about the behaviour you described (does this effect aready occur by two "dialogs" ...)? And how do you proceeding (sampe code)?

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • 1. Storage Memory : 4 MB
    Program Memory: 14 MB


    2. Visual studio.NET 2003


    3. Code example :


    ....
    if (Form5.ShowDialog() == DialogResult.OK)
    {
    .....
    }


    * When we exit to the Dialog by OK the system shows the same form
    again and show the old values. The system is locked here until "out
    of memory" error appears (because I think that the forms are never
    closed)

  • Quote from "oscar"

    3. Code example :
    ....
    if (Form5.ShowDialog() == DialogResult.OK)
    {
    .....
    }


    Are you sure that you're not running in some loop, opening the dialog again yourself? Can't you set a breakpoint after the dialog and step through the program?


    Did you override any functions of the dialog class? Probably there is the part where the redrawing occurs. Try to comment away the code of these functions one by one to narrow down the position of the error.


    Regards,


    H. Keller

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hello,


    i assume you are using the "X" for close the "second" form (Form2). I test to close the form by using a button (Button1) and it works fine:


    Code
    1. <System.Runtime.InteropServices.ComVisible(False)> Public Class Form2
    2. Private Sub Button1_Click(ByVal sender As System.Object,
    3. ByVal e As System.EventArgs)
    4. Handles Button1.Click
    5. Close()
    6. End Sub


    So i suggest the "X" does more then only closes the form. When i spy messages (by the EVC++ remote spy) i see the every dialog gets a series of varoius messages (WM_ACTIVATE, WM_SETFOCUS, ...). I think you have to "catch" the messages (and edit the message handlers - but best may be you refer a microsoft sample).

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • This application is working OK in another board (Geode + 64MB RAM + 32FLASH) and Windows CE 4.2.



    The first time when I executed the application, I had a windows message
    that tell me "Insufficient Program memory" or similar. For this reason I modified the memory configuration to 4MB for Storage memory and 14MB for Program Memory. In this situation, the application starts ok, but when the application has several opened dialogs when I try to close the focused windows by "OK button" the dialog appears again and it lost the latest changes.


    Any idea ?


    Thanks in advance


    Oscar

  • OK, we have narrowed it down a little bit more. The problem depends on the Compact Framework. When using CF1.1, the problem does not exist, only when using CF2.0. Currently we are investigating further, what we can do.


    Regards,


    H. Keller

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • I downloaded the NK82_CF060518.zip


    I have tried my application and it works better but has still problems
    with some dialogs.


    This version use CF 1.1 or CF 1.0 ? I am sure that my application runs well with CF 1.0







    Quote from "keller"

    OK, we have narrowed it down a little bit more. The problem depends on the Compact Framework. When using CF1.1, the problem does not exist, only when using CF2.0. Currently we are investigating further, what we can do.


    Regards,


    H. Keller

  • Quote from "oscar"

    Do you know anything more about the dialogs and Compact Framework ?
    I still have problems.


    I assume you have installed the kernel with CF1.1. Now when you store your application on the board, e.g. in FFSDISK, then restart the board and start your application, the problem should not appear.


    On the other hand, if you use the VS2005, download the code to the board and run it from the debugger, then VS2005 will download the new CF2.0 together with the program. So in this constellation the problem will appear again *even* with the CF1.1-Kernel. Because the downloaded CF2.0 from the debugger will override the pre-installed CF1.1.


    My suggestion is: test your application, ignore the window error. When everything is done, store your applicatiojn in FFSDISK, reboot the board and try again (without debugging). Then the window error should have disappeared.


    Quote from "oscar"

    My application works now in a competitor PC board with Win CE 4.2 and CF 1.0


    I'm sorry to hear this. But as the problem is inside of CF2.0, we have no influence on it. The problem is a problem of Microsoft, not our company. You will have the same problems on the other board when using CF2.0 there. In fact I can't believe that you are using VS2005 there, as this requires CF2.0 on the target.


    Regards,


    H. Keller

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.