Plug-in area references on 64 bits 4D

It is common practice with plug-in areas to allocate the area’s private data during initialization (eAE_InitAdvancedProperties event) and to store the pointer to that data with PA_SetAreaReference().

However, due to the fact that the plug-in area reference from 4D’s side is stored in a C_LONGINT (32 bits, the variable associated with the area in the form editor), and because sizeof(pointer) != 32 on 64 bits, I don’t see an obvious way to convert the 32-bit C_LONGINT value to the plug-in area’s private data pointer in plug-in calls that address the specific area.

For example, during the eAE_InitAdvancedProperties event I allocate my private data and pass the address to 4D with PA_SetAreaReference(). I see in the debugger that the address of my private data is 0x103719000. I also see in the 4D debugger that the value of the 4D variable associated with the plugin area is 0x002E3180.

Now, I have a call SetAreaFoo(areaRef;bar) that addresses that plug-in area instance.

My question is, how can I convert the area reference passed in the first parameter (0x002E3180) to the pointer holding the private area data (0x103719000)?

I would expect that there is some function/entrypoint in the plug-in API that does this conversion, but I can’t find one.

Thanks,

-Danis

PS. Is there be an updated 4D Plugin API for v16? The latest one at the SVN repository is for v15 with the last change done 4 months ago.

I use std::map to map 64 bit pointers to 32 bit 4D longints that can be passed between 4D and plugin.