I need help making code work for PB 6.11

Just starting out? Need help? Post your questions and find answers here.
novablue
Enthusiast
Enthusiast
Posts: 177
Joined: Sun Nov 27, 2016 6:38 am

I need help making code work for PB 6.11

Post 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?
User avatar
idle
Always Here
Always Here
Posts: 5834
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: I need help making code work for PB 6.11

Post by idle »

Not sure what's going on there. The imports looks right.
Post Reply