IMA sous Linux
Publié : jeu. 11/sept./2008 17:57
Bonjour,
Voilà, travaillant sur ce code (Source : http://www.purebasic.fr/french/viewtopic.php?t=7020)
Quand je l'exécute, j'ai un invalid memory access en ligne 34.
C'est pourquoi, je reviens vers vous pour m'aider.
Merci d'avance...
Voilà, travaillant sur ce code (Source : http://www.purebasic.fr/french/viewtopic.php?t=7020)
Code : Tout sélectionner
CompilerIf #PB_Compiler_Thread ;>
#ObjectManager = "compilers/objectmanagerthread.a"
CompilerElse ;=
#ObjectManager = "compilers/objectmanager.a"
CompilerEndIf;<
Import #PB_Compiler_Home + #ObjectManager
Object_GetOrAllocate (Objects, Object.l) As "PB_Object_GetOrAllocateID"
Object_GetObject (Objects, Object.l) As "PB_Object_GetObject"
Object_IsObject (Objects, Object.l) As "PB_Object_IsObject"
Object_EnumerateAll (Objects, ObjectEnumerateAllCallback, *VoidData) As "PB_Object_EnumerateAll"
Object_EnumerateStart (Objects) As "PB_Object_EnumerateStart"
Object_EnumerateNext (Objects, *object.Long) As "PB_Object_EnumerateNext"
Object_EnumerateAbort (Objects) As "PB_Object_EnumerateAbort"
Object_Free (Objects, Object.l) As "PB_Object_FreeID"
Object_Init (StructureSize.l, IncrementStep.l, ObjectFreeFunction) As "PB_Object_Init"
Object_GetThreadMemory (MemoryID.l) As "PB_Object_GetThreadMemory"
Object_InitThreadMemory(Size.l, InitFunction, EndFunction) As "PB_Object_InitThreadMemory"
EndImport
Structure TEST
TEST.l
EndStructure
Macro THIS_INITIALIZE(hCloseFunction)
Object_Init(SizeOf(TEST), 1, hCloseFunction)
EndMacro
Declare freeobject(object.l)
Procedure ObjInit()
Global obj = THIS_INITIALIZE(@freeobject())
EndProcedure
Procedure NewObject()
Protected *this.TEST = Object_GetOrAllocate(obj, #PB_Any)
If *this
*this\TEST = 10
EndIf
ProcedureReturn *this
EndProcedure
Procedure freeobject(object.l)
EndProcedure
ObjInit()
obj = NewObject()
C'est pourquoi, je reviens vers vous pour m'aider.
Merci d'avance...