Problem - empty WPTools Editor

  • Hello

    It's hard to describe the problem ...

    We have the problem, that sometimes (it depends on the PC . sometimes often sometimes not so often) the Editor is empty.
    I have seen it that its only if other Microsoft Office Product are running (Excle, Word, Outlook) without these Programs running it doesn't happen (or doesn't hapen so fast)
    In our application, i can open a task (this is a WPTools Editor), on these PC, i open 5-6 task, the 6th task is empty. Than i have to close 3 tasks, and than i can open it correctly.
    Without Word or co, i can open many task simultan - without problem.
    On my Development machine i can open 15 task without problem (regardless if word is running or not - but these are Windows XP machine ...)
    The other PC are Windows 7, Windows 8, Windows 10, or Windows Terminal Server - all are the same.

    I checked allread the handles and co, seems correct, my application needs many of them, but there should be enough available.
    No error or somethin else.

    Maybe you have some additonal idees what i can check, or what the problem could be?

    • Offizieller Beitrag

    WPTools formats the text only in idle phases. This uses messages. If a message is missing formatting does not take place and the editor could look empty.

    To get more information I would hide a button somewhere which saves the current content to a file - so you can see if the editor is really empty.

    Also useful is code which calls ReformatAll directly or the function CheckHasBody which makes sure a document is selected for view. (WPTools separates display from text storages).

    Julian

  • ok i will check it on monday (some user in our company have the same problem) - but i think it has nothing to do qith messages and idle time ----

    As far as i know i have allready a ReformatAll in my open process ....

    - with check the content - do you mean a Editor.SaveToString?

    I don't think that the Editor is "empty" - i think that the painting isn't working

    I try to post on monday a picture how the editor looks in this state ...

  • So just checked it...

    I open 6 Forms with a WPEditor on every form .... all 6 Editors works fine
    the 7th editor which i has opened is not working.
    Closing the 6 working Editors ... and let the not working editor open - it still not working.
    It means i can enter chars on the first line, and i can see these chars ... if i get a line wrap i didn't see anything.
    Or if i click on an other line and change there some chars - i didn't see the change.

    If i call a ReformateAll - I can see all my changes. But all changes i make now i can'T see still i make an additional ReformatAll.

    And the first editor i have opened is working.
    If the editor is loaded and showed on form creation ll works. If the Editor is empty on form create (by the way not really empty but no painting occurs) it didn'T get working regardless if i close 5 other editors.
    And if i have Microsoft office application running - i can't create fewer WPEditor.

    If i execute my application twice - every application can execute for example 6 working Editors.

    • Offizieller Beitrag

    This can be caused by another 3rdparty component. WPTools is using messages a lot - you see that in unit WPCtrMemo.pas

    If you see the text after reformatall and then not anymore this means the messages are not received anymore.

    You can try to give
    WM_WPTOOLSUPDATE

    a different message number in WPCtrMemo.pas. I hope this helps.

    Julian

  • But waht i didn't understand with this explanation.

    It is one application
    with 1 form
    i open this form 5 times (with differnt Text data) all WP Editor works
    i open 2 additional forms - they don't work - ReformatAll works (but i have to execute it every time)
    the first 5 forms works perfect.
    i close the first 5 woking forms
    the 2 forms i opened and was not working - are still not working.

  • Yes its very curious.
    I just tested it on one PC - the Message WM_WPTOOLSUPDATE is sent and received,

    I set a variable to now in the procedure TWPCustomRtfEdit.WMWPTOOLSUPDATE ... and checked it.. everty time i enter a char, this variable has been updated, but i see no text on the screen - if i execute ReformatAll manually than i see the text!

    I allray changed the Value of the WM_WPTOOLSUPDATE.

    And yes the component is on a PAgeControl, but an other form, has the same effect - and this window have no PageControl on it.

    I have a DebugText of same vars in this procedure ... maybe you can say something ....

    fNowDestroy: 0 wParam: 5 lParam: 0, InWaitForPAintEditor: 0 IsDynamic: 0 Locked: 0

  • no i can't make a simple project ... in a simple test project i can open about 80 editors without problems, the same in my big project the 6th editor is wrong and empty ----
    What can i check else?

  • No - no threading (there are some threads in background but not for the GUI only for tasks like TCP/IP and so)

    My first thought was also the ressource problem, but in Task manager i can see that i use many handles, but as i know the limits are 10.000 and my application is "only" 5000-6000.

    And if i has Excel not running, i can open 20 Editors in my application, with excel i can open only 5 editors.
    But if excel running, i can start my application 4 times, and in every application i can open 5 editors
    Which means, the application running alone without excel, can start 20 editors without problems - therefore should no problem with the system per application.
    And if excel is running i can start my application 4 times ....

    And if it is a problem with the handle, shouldn't i get some exception?

    I have some Timers in my application ....

    • Offizieller Beitrag

    I am not sure if you would get an exception.

    WPTools has the ability to edi multiple text within one editor since the data is seperated from the editor logic. So it is possible to edit an "unlimited" number of texts within one editor without duplication of window handles.

    If there is a resource probelem I don't know what I can do. WPTools does not use many handles.