Announcement

Collapse
No announcement yet.

Per new milenium without problems

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Per new milenium without problems

    Hi
    Happy NEW YEAR for All's.
    ---------------------------
    One small problem with DDT.

    I have made some project,
    I heavily checked the project.
    And I receive not correct action of DDT.

    !!!!! Without the seen reasons
    !!!!! Disappear's DDT CONTROLS (LABEL,BUTTONS,IMGBUTTONS...)


    (I have cleaned from the project use of every possible images !)

    In the project some times create,works and leaves DDT.

    Something on similarity
    ----
    for i=1..200
    DIALOG NEW
    controls
    ...
    DIALOG END
    next i
    ----
    ================================================
    Project use 19 database file , Size all DATABASE 650 mb.
    I use 128mb memory.

    I tested memory, Memory is not overflown.
    I use classic scheme of use DDT

    What is it ???

    Thank,
    Again,Happy NEW YEAR.

    V.Shulakov




    ------------------
    Spherical Panorama Inc. Virtual Reality for: Real Estate, Tourism Advertisment.

  • #2
    Unfortunately your description is a little vague, but it definitely sounds like you are still running out of GDI resources.

    For efficiency reasons, DIALOG NEW, CONTROL ADD, etc, do not report run-time errors with ERR or ERRAPI, so detecting low resource conditions can be a little tricky (unless your app uses a LOT of memory/resources, such conditions are rarely ever a problem).

    Have you monitored resources while your app is running? What O/S's have you tried this on? Usually it is much harder to run out of GDI resources under NT/2000 than Win9x.

    You could try using a tool like MemCheck or BoundsChecker to monitor your app's internal behavior while checking for memory leaks, etc. Search the BBS for "memcheck" and you should find some relevent info and links.

    So, in summary, without being able to actually witness the problem for ourselves it is difficult to make specific suggestions. However, if you continue to prune the project, can you determine at what point the app runs correctly? Can you post a (small) compilable example that still shows the problem?

    Thanks & good luck!


    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Something similar happened to me not long ago in a dialog where an
      error in a routine at the beginning of PBMAIN caused the controls
      to never show up. The error was simple, a faulty API call and once
      I fixed it, everything worked fine again. Never bothered to ask
      myself why the controls never showed up, even if that was a bit strange.

      What I'm trying to say is that it may have something to do with
      the code you execute in between. I call them "hanging errors",
      because they occur in one place, but causes problems in another.
      Often tricky ones to find, those, because one is fooled to look
      in the wrong place..

      A tip is to use IF ERR THEN.. at some critical points in the code.
      A good way to find out if and when an error is created, and if it
      never is triggered but problems remain, you most likely have a
      memory problem of some sort..


      ------------------

      Comment


      • #4
        + try at least 1 msgbox for testing..
        If shown, API declares are fine.


        ------------------
        [email protected]
        hellobasic

        Comment


        • #5
          Thank's by all!

          My Large project consists of 15 small parts.
          ---------------------------------------------
          Each small part separately works very well !
          ---------------------------------------------
          During 9 months, all small parts (separately) works very well !
          I think this problem is connected to loss handle specific CONTROL
          ---------------------------------------------
          I have noticed one feature large project.
          In the other large project (I use OPENGL for this proj.)
          there is a restriction on quantity of external functions.
          If I am not mistaken, it - approx. 1500

          I use WIN98 SE,AMD k6-2-550, 128 mb/mem
          main database occupies 60 mb from 128 mb,
          Other databases I are used for search (They use 2-3 mb for search)

          I try to test err, but size source programm ~ 550-600 kb

          Thank for the help !
          I understand - the large projects -> large problems...

          --V.Shulakov





          ------------------
          Spherical Panorama Inc. Virtual Reality for: Real Estate, Tourism Advertisment.

          Comment


          • #6
            Code:
            for i=1..200
            DIALOG NEW
            controls
            ... 
            DIALOG END 
            next
            In your For/Next loop where is your messagepump?
            Is it in the same thread?
            Do you use Dialog doevents..


            ------------------
            Fred
            mailto:[email protected][email protected]</A>
            http://www.oxenby.se

            Fred
            mailto:[email protected][email protected]</A>
            http://www.oxenby.se

            Comment


            • #7
              Hi Fred !

              I use for For each small part project separate thread.
              I use DOevent.
              I use classic scheme DDT

              --V.Shulakov


              ------------------
              Spherical Panorama Inc. Virtual Reality for: Real Estate, Tourism Advertisment.

              Comment


              • #8
                Volodja --
                Windows have serious problems with multi-tasking. It's well-known feature.
                I beleive that some of your threads simply doesn't receive enough CPU time to process messages.
                Why do you use threads ? Is it possible to avoid ? (for example, modeless dialogs)

                ------------------
                E-MAIL: [email protected]

                Comment


                • #9
                  Volodja --

                  Unlike Semen, I have had very good results using multiple threads.

                  Volodja, is DOEVENTS being performed in the same thread that created the main window? That is a requirement of Windows...

                  -- Eric

                  ------------------
                  Perfect Sync: Perfect Sync Development Tools
                  Email: mailto:[email protected][email protected]</A>
                  "Not my circus, not my monkeys."

                  Comment


                  • #10
                    I was enough surprised by Eric's words and decided to test.
                    Really my impression was linked with parallel execution of some my console programs.
                    I made a simple test with counters in threads.
                    Under 2000 results were excellent (about +/-5%), under 95 OSR 2 and ME - +/-20%.

                    Well, I agree: at least, in foreground process threads works fine.

                    ------------------
                    E-MAIL: [email protected]

                    Comment


                    • #11
                      Thank's Semen and Eric.

                      I think, Semen thinks the truth (about my problem)

                      MAIN DDT DIALOG Derivates several MODELESS DIALOGs,each of which,
                      derivates threads
                      (each threads - Carries out search in datebase file)
                      DOEVENT works, but then I have more threads(get files data) - that
                      DOEVENT works worse.

                      I use DOEVENTS as classic scheme.

                      Feature of problem:
                      It is possible to execute simultaneously search in no more
                      than 5-6 files.
                      The performance of search in other databases is possible after clearing resources of the processor
                      (for example - After end of search in 1-2 databases)
                      I don't use indexed search for Minor databases.

                      Me surprises - that vanish even CONTROL LABEL !
                      (in main dialog or minor dialog)
                      Them as were not !

                      Eric , You are correct, but you can try simultaneously
                      GET DATA_REC from 10 files (size of files - 3.5 ~ 40 Mb)
                      Maybe you receive some interesting threads results.

                      Thank
                      Again,Happy NEW YEAR
                      V.Shulakov


                      ------------------
                      Spherical Panorama Inc. Virtual Reality for: Real Estate, Tourism Advertisment.

                      Comment


                      • #12
                        Vladimir --
                        You wrote "I use DOevent." Interesting - why ?
                        Typically there is modal dialog and child modeless.
                        Dialog DoEvents are not used at all.

                        I know one situation only, when it's necessary to execute Dialog DoEvent -
                        when program doesn't stop calculations during a long time.

                        Without code it's not possible to say something.
                        But I remember own mistakes and can imagine that you, probably, read some records and execute Dialog DoEvents.
                        If so, it will be troubles, because Dialog Doevents process one message only (like I understand).

                        Just now I do not use Dialog DoEvents at all - I use something like this
                        Code:
                              
                              While PeekMessage(Msg, %NULL, %NULL, %NULL, %PM_REMOVE)
                                 If IsDialogMessage(hDlg, Msg) = %FALSE Then
                                    TranslateMessage Msg
                                    DispatchMessage Msg
                                 End If
                              Wend
                        which allows to process ALL messages, which are currently in query.

                        ------------------
                        E-MAIL: [email protected]

                        Comment


                        • #13

                          Semen ,
                          maybe you not correctly have understood me.

                          Sense of such:

                          The conversation goes about DDT:
                          ------------------------------------------------------
                          MAIN dialog -> gives rise ->
                          -> Four simultaneously working, MODELESS dialogs ->
                          -> Each of these dialogues simultaneously carries out a few THREAD,
                          Which carries out access to a some database ->
                          -> After termination search, -> gives rise ->
                          new MODELESS dialogs...
                          (Constantly works MAIN DIALOG and some "Minor" dialogues,
                          Which are be active or no active.)

                          I use DIALOG DOEVENTS for:

                          = processes pending window or dialog messages and =
                          = releases the remainder of the process's timeslice =

                          I understand that:

                          = DIALOG DOEVENTS should NOT be called unless at least =
                          = one dialog created using DIALOG NEW is active. =

                          I have tried various variants of use multitasking -
                          Result one - are lost various CONTROL (LABEL,TEXTBOX,IMGBUTTONS,BUTTONS ...)
                          All this - concerns only DDT.

                          I think that some controls handles are lost ,
                          other mistakes in work has not noticed.

                          Small similar programm work very good (reading 1 database file).
                          The problem arises, when there is a simultaneous reading 5-6 database files ...

                          -- V.Shulakov




                          ------------------
                          Spherical Panorama Inc. Virtual Reality for: Real Estate, Tourism Advertisment.

                          Comment

                          Working...
                          X