Seite 1 von 1

Bug in RichEdit? [erledigt]

Verfasst: 20.12.2004 22:08
von MJP
Ich glaub ich hab einen Bug in RichEdit gefunden! :o Immer wenn ich das Programm ohne Debugger Copiliere kommt beim schließen eine Fehlermeldung! :freak: Das nervt halt obwohl das Programm läuft!
Kleines Beispiel:

Code: Alles auswählen

If OpenWindow(1, 353, 174, 307, 234,  #PB_Window_SystemMenu | #PB_Window_TitleBar , "Test")
  If CreateGadgetList(WindowID())
      OpenRichEdit(WindowID(),2, 10, 10, 170, 200,"")
      ListIconGadget(3, 190, 10, 110, 120, "Column1", 106)
      StringGadget(4, 190, 140, 110, 70, "")
      ButtonGadget(5, 190, 210, 110, 20, "Senden") 
      ChangeRichEditOptions(#ES_READONLY)
  Endif 
Endif 
Repeat
  EventID.l = WaitWindowEvent()
  If EventID = #PB_Event_CloseWindow
    Quit = 1
  EndIf
Until Quit = 1
End
THx MJP

Verfasst: 20.12.2004 23:14
von ts-soft
Habe die Lib nicht installiert, glaube aber zu wissen, das das RichEdit mit CloseHandle_(RichEdit) geschlossen werden muß, bevor Du das Programm beendest.

Code: Alles auswählen

If OpenWindow(1, 353, 174, 307, 234,  #PB_Window_SystemMenu | #PB_Window_TitleBar , "Test")
  If CreateGadgetList(WindowID())
      RichEdit =OpenRichEdit(WindowID(),2, 10, 10, 170, 200,"")
      ListIconGadget(3, 190, 10, 110, 120, "Column1", 106)
      StringGadget(4, 190, 140, 110, 70, "")
      ButtonGadget(5, 190, 210, 110, 20, "Senden")
      ChangeRichEditOptions(#ES_READONLY)
  Endif
Endif
Repeat
  EventID.l = WaitWindowEvent()
  If EventID = #PB_Event_CloseWindow
    Quit = 1
  EndIf
Until Quit = 1
CloseHandle_(RichEdit)
End

Wie gesagt kann's nicht ausprobieren

Verfasst: 21.12.2004 01:17
von El_Choni
This would be the "correct" proceeding:

Code: Alles auswählen

If OpenWindow(1, 353, 174, 307, 234,  #PB_Window_SystemMenu | #PB_Window_TitleBar , "Test")
  If CreateGadgetList(WindowID())
      OpenRichEdit(WindowID(),2, 10, 10, 170, 200,"")
      ListIconGadget(3, 190, 10, 110, 120, "Column1", 106)
      StringGadget(4, 190, 140, 110, 70, "")
      ButtonGadget(5, 190, 210, 110, 20, "Senden")
      ChangeRichEditOptions(#ES_READONLY)
  EndIf
EndIf
Repeat
  EventID.l = WaitWindowEvent()
  If EventID = #PB_Event_CloseWindow
    Quit = 1
  EndIf
Until Quit = 1
CloseRichEdit(2) ; <--
End
The lib should free the resources it creates at program exit, but there wasn't the possibility of including 'End' functions in the PureLibraries when I coded it. Anyway, to be honest, I didn't expect this kind of Windows error. Probably doesn't happen in Windows 9x (which is what I used to code the lib).

And sorry for my awful German, sounds almost like English :mrgreen:
(hey, we don't have these smilies at the english forum, I want them!)

Verfasst: 21.12.2004 13:45
von MJP
:oops: Das hatte ich nicht gewusst
THx 4 Help!

Verfasst: 21.12.2004 15:23
von M@xx
(hey, we don't have these smilies at the english forum, I want them!)
You could save the pictures and put them into your text with url, /ulr.
But that's a little bit circumstantial(?) :mrgreen: