Windows system tray

BlitzMax Forums/Brucey's Modules/Windows system tray

Thareh(Posted 2016) [#1]
Hey,

I'm currently playing around with BMX-NG for a MaxGUI project of mine, and I've got a couple of modules for the system tray in windows - however they do not compile :/

I get the error atm "Only string, arrays and pointers may be indexed." on this code:
Function OpenObjHandle ( obj:Object )
  ( Int Ptr Ptr Varptr obj ) [ 0 ] [ 1 ] :+ 1 '<--- this line
  Return ( Int Ptr Varptr obj ) [ 0 ] + 1
EndFunction


Why do I get this error? and what can I do to fix it?

(I'm compiling for 32-bit)

Thanks,
-- Thareh


Derron(Posted 2016) [#2]
I think Brucey will have to update BCC to handle that...


PS: Without brackets this "int ptr ptr varptr" looks really hm... hard to understand at the first glance :-)

bye
Ron


Bobysait(Posted 2016) [#3]
I don't know if this does the same

Function OpenObjHandle ( obj:Object )
	Local a:Int Ptr Ptr= Int Ptr Ptr obj
	a[0][1] :+ 1 ' increase a "usage" counter ?
	Return (Varptr a[0]) + 1
EndFunction



Brucey(Posted 2016) [#4]
What are you trying to do exactly?

If you are trying to "cheat" the garbage collector by applying your own reference counting to it, I'm afraid that NG doesn't work like that - because it uses a different GC. The internal structure of objects is different.

There are macros (at the C level) you can use to do this properly : BBRETAIN(obj) and BBRELEASE(obj)

So, it's probably better for you to write some glue code which would work across all versions.

Also, what are you trying to return?