Thread and InvalidAccesMemory

Mac OSX specific forum
oliv
User
User
Posts: 42
Joined: Sun Aug 24, 2003 10:11 am
Location: France

Thread and InvalidAccesMemory

Post by oliv »

Hi,
I don't know if I must post this problem in "bug section" or not, because it can be a mistake, but it works on Windows.

When I try to push the button "Publier" there is an "Invalid Acces Memory" error. Is anyone know why or is it a bug ?

Thanks

Code: Select all

EnableExplicit ; Force à déclarer correctement




;-  *****   Déclarations   *****
; Constantes
#W_Main = 0 ; Constantes des fenêtres


Enumeration ; Gadgets
  #Publier
EndEnumeration

; Structures

; Listes
; Tableaux

; Variables
Define.b Sortie

Procedure Publier(Par.l) ; Envoi le post au serveur
EndProcedure








;- *****    Fenêtres   *****
If OpenWindow(#W_Main, 0, 0, 500, 500, "PBlog", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered) = 0
  MessageRequester("Erreur", "Ouverture de la fenêtre principale impossible.")
  End
EndIf

;- *****    Gadgets listes    *****
CreateGadgetList(WindowID(#W_Main)) ; Fenêtre principale
  ButtonGadget(#Publier, 5, 430, 60, 25, "Publier")




;- *****    Boucle principale    *****
Repeat
  Select WaitWindowEvent(10) ; Sélection des évènements
    Case #PB_Event_CloseWindow ; Fermeture
      Sortie = 1

    Case #PB_Event_Gadget ; Evènements sur un gadget
      Select EventGadget()
        Case #Publier
          CreateThread(@Publier(), Sortie)
      EndSelect

  EndSelect

Until Sortie = 1

End