Bug in RichEdit? [erledigt]

Für allgemeine Fragen zur Programmierung mit PureBasic.
Benutzeravatar
MJP
Beiträge: 72
Registriert: 14.10.2004 18:45
Wohnort: Nähe Frankfurt/Hessen
Kontaktdaten:

Bug in RichEdit? [erledigt]

Beitrag 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
Zuletzt geändert von MJP am 21.12.2004 13:52, insgesamt 2-mal geändert.
Alle Reschtsreib feler sind beabsichticht unn kosten nichs echtra ;-D
Visit ---|> http://www.Komani.de/
Benutzeravatar
ts-soft
Beiträge: 22292
Registriert: 08.09.2004 00:57
Computerausstattung: Mainboard: MSI 970A-G43
CPU: AMD FX-6300 Six-Core Processor
GraKa: GeForce GTX 750 Ti, 2 GB
Memory: 16 GB DDR3-1600 - Dual Channel
Wohnort: Berlin

Beitrag 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
PureBasic 5.73 LTS | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.
Bild
El_Choni
Beiträge: 5
Registriert: 14.09.2004 15:22

Beitrag 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!)
Benutzeravatar
MJP
Beiträge: 72
Registriert: 14.10.2004 18:45
Wohnort: Nähe Frankfurt/Hessen
Kontaktdaten:

Beitrag von MJP »

:oops: Das hatte ich nicht gewusst
THx 4 Help!
Alle Reschtsreib feler sind beabsichticht unn kosten nichs echtra ;-D
Visit ---|> http://www.Komani.de/
Benutzeravatar
M@xx
Beiträge: 57
Registriert: 07.10.2004 11:30
Wohnort: Kiel
Kontaktdaten:

Beitrag 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:
mfg, Max

Computerkunde: "Ich suche noch ein spanndendes Grafik-Adventure, das mich so richtig fordert"
Verkäufer: "Haben Sie es schon mal mit WINDOWS 95 probiert ?"

http://bratwurst-24.de.ki
Antworten