DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

GPI Extension : attach special user data to data object

Hi !

I'm writting a GPI dll extension for Diadem wich uses some C++ objects.

I want to link theses objects with Diadem data channels, can I use the lpReserved element of the TDataObjHeader structure (used with nDataObjHeaderGet and Set DATA-API service routines)?

Is there any other Diadem DATA variable available to store an address pointer ?

Thanks for your answer(s).

jma.
0 Kudos
Message 1 of 4
(3,967 Views)
Hi jma,

Unfortunately you can not use the lpReserved element because this element is reserved for future developments. It is also not possible to use any other elements in our structures.

There are two reasons for this:
------------------------------------------------------
a) All lpReserved elements are reserved and the other elements have a special meaning.
b) You wouldn't be informed about DATA events such as “deleting a channel” or “deleting the complete dataset”.

You can, however, use the two add on attributes, which are available for each channel, which you can set and read with:
------------------------------------------------------
lDataProperties(eChannellUserSet, , )>) AND
lDataProperties(eChannellUserGet, , )

Here you need to be careful, though, because:
------------------------------------------------------
1) The customer can change these values in a VBScript
2) You won’t be informed about any channel-related events

But you would have the advantage that if the DIAdem user modifies the order of channels in DIAdem, you (the GPI-DLL author) would still have the right pointer behind the right channel, as long as you maintain your own channel pointer look-up list to verify that the pointer value hasn't been changed by the user to an invalid one.

Regards,
Brad Turpin
NI
0 Kudos
Message 2 of 4
(3,967 Views)
One small correction/clarification,

The additional channel integer attributes mentioned above are the same as you see in the DATA-Channel-Properties window. There are actually 5 of them, and they can be accessed either interactively in the Channel Properties window or in a VBScript by using their DIAdem variables:

ChnAttrInt1
ChnAttrInt2
ChnAttrInt3
ChnAttrInt4
ChnAttrInt5

So the eChannelUserSet/Get methods above have not just 2 index options (0 or 1) but rather 5 index options (0..4), corresponding to ChnAttrInt1..ChnAttrInt5.

Brad Turpin
NI
0 Kudos
Message 3 of 4
(3,967 Views)
Hi Brad !

Thank for your answer.

Your solution was my B plan, I hoped some uneditable variable (like user data in Windows objects) would allowed me an "invisible" handling.

Therefore, I will use ChnAttrInt(i), and it will work !

Best Regards.

JMA.
0 Kudos
Message 4 of 4
(3,967 Views)