Page 1 of 1

I need help making code work for PB 6.11

Posted: Thu Jul 25, 2024 1:32 am
by novablue
Hello, i was using this code on Purebasic 6.10 x64 and it always worked without any issues. Now with Purebasic 6.11 i am getting an error all of the sudden.

Invalid memory access at line:

Code: Select all

*object = Object_GetOrAllocateID(g_DshowObjects, *This)
And Object_GetOrAllocateID() is imported like this:

Code: Select all

Import "ObjectManager.lib"
	CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
		Object_GetOrAllocateID(*Objects, Object.i) As "_PB_Object_GetOrAllocateID@8"
		Object_GetObject(*Objects, Object.i) As "_PB_Object_GetObject@8"
		Object_IsObject(*Objects, Object.i) As "_PB_Object_IsObject@8"
		Object_FreeID(*Objects, Object.i) As "_PB_Object_FreeID@8"
		Object_Init(structuresize.i, IncrementStep.i, *ObjectFreeFunction) As "_PB_Object_Init@12"
	CompilerElse
		Object_GetOrAllocateID(*Objects, Object.i) As "PB_Object_GetOrAllocateID"
		Object_GetObject(*Objects, Object.i) As "PB_Object_GetObject"
		Object_IsObject(*Objects, Object.i) As "PB_Object_IsObject"
		Object_FreeID(*Objects, Object.i) As "PB_Object_FreeID"
		Object_Init(structuresize.i, IncrementStep.i, *ObjectFreeFunction) As "PB_Object_Init"
	CompilerEndIf
EndImport

I assume something changed in 6.11 with "PB_Object_GetOrAllocateID" but i don't know how to fix it. Can somebody help me please?

Re: I need help making code work for PB 6.11

Posted: Thu Jul 25, 2024 4:19 am
by idle
Not sure what's going on there. The imports looks right.