Can someone help me? I don’t understand my error…
In my program I use ptnumericinteger and ptnumericfloat, and I want to recover value of them so I use this code :

/* for ptnumericinteger */

int *pVal, Val=0;
PtGetResource(ABW_Int_Ond_Mono_Calc_NBAngle,Pt_ARG_NUMERIC_VALUE, &pVal,0);
Val = *pVal;
PtSetResource(ABW_Int_Data1,Pt_ARG_NUMERIC_VALUE, Val,0);

This code is Ok, I have no problems to recover values.

/* for ptnumericfloat */

double *pAngle, Angle=0; PtGetResource(ABW_Float_Ond_Mono_Calc_Angle2,Pt_ARG_NUMERIC_VALUE, &pAngle,0);
Angle = *pAngle;
PtSetResource(ABW_Float_Data4,Pt_ARG_NUMERIC_VALUE, Angle,0);

But this time the program stops and invoke a memory corrupted error.

So can someone help me to recover values from ptnumericfloat please???


I’m French, so my english could be bad :laughing:

hi ,
Your code is correct, only while setting resources for PtNumericFloat
use [&Angle] instead of Angle.

It will work.

correct use:
PtSetResource(ABW_float1,Pt_ARG_NUMERIC_VALUE, &Angle,0);

Ok it’s good, thanks a lot