I'm having a problem printing (with DrawText) a function pointer.
The function I want to print the pointer of is held within a Type. I am trying to reference it from within a function within a separate program file which is included. For example:
I have no idea if this code works, it's a gross approximation. But it basically sums it up... I'm trying to display a function pointer - ie the content of the function pointer itself - showing where it points, from within a function which is in an included program (#2), where the function I need to know the ptr to is in an instance of a type defined in the main program (or in some other included program).
I can't tell what's wrong but it seems that blitzmax thinks the function pointer is an int() instead of `int() int` and can't be indexed.
How can I get it to display that function pointer?
The function I want to print the pointer of is held within a Type. I am trying to reference it from within a function within a separate program file which is included. For example:
'This is program 1 Include "program2.bmx" Type mytype Field a:Int Function myfunction() 'do stuff End Function End Type 'other stuff happens too Global myf:mytype=New mytype myfunction2() End 'This is program 2 which is included: Function myfunction2() Local obj:mytype=myf DrawText String(Int(Int Ptr(Byte Ptr(obj.myfunction2))[0])),50,50 'something like this creates an error, saying myfunction2 is an int() End Function
I have no idea if this code works, it's a gross approximation. But it basically sums it up... I'm trying to display a function pointer - ie the content of the function pointer itself - showing where it points, from within a function which is in an included program (#2), where the function I need to know the ptr to is in an instance of a type defined in the main program (or in some other included program).
I can't tell what's wrong but it seems that blitzmax thinks the function pointer is an int() instead of `int() int` and can't be indexed.
How can I get it to display that function pointer?