Hi, All, I have a question regarding the memory management on the labels
that associate with popup triggers or select triggers. When I
programmactically set the labels I encountered some problems.
Code looks like this:
   tmpStr1 =CtlGetLabel(GetObjectPtr(PopTrigger1));
   CtlSetLabel(GetObjectPtr(PopTrigger1), anotherStr);
What happened to tmpStr1? is there a memory leak hazard here?
If the code looks like this:
   tmpStr1 =CtlGetLabel(GetObjectPtr(PopTrigger1));
   StrCopy(tmpStr1, anotherStr);
   CtlSetLabel(GetObjectPtr(PopTrigger1), tmpStr1);
When the anotherStr is longer than the tmpStr1, I got all kind of  weird
problems, like the labels for the other selecttriggers in the same form
disappeared, or get over-written.

So what is the rule of thumb dealing with CtlLabels?

Thanks,

Reply via email to