Thanks for responding, Greg and Kostya.
the exact bit of code was:
int32 *Analogs;
Analogs = (int32 *)DSNewPtr(sizeof(int32));
Analogs = (*var1)->_0_V_Power_Supply_VDC_;
/*
.
array operations
.
*/
DSDisposePtr(Analogs);
when i debugged the CIN using DebugBreak, it always crashed at the
DSDisposePtr(Analogs);. i guess that's because i was trying to delete
(*var1)->_0_V_Power_Supply_VDC_ instead of the pointer Analogs? my
program seems stable if i get rid of the DSDisposePtr... but is this ok?
do i even need the DSNewPtr? if i leave this around will it end up
leaking a whole lot of memory or will NT be able to clean it up after LV
is closed?
Thanks again
Eugene
In article <8lr4sm$qc8$1@nnrp1.deja.com>,
Kostya wrote:
> Eugene,
>
> I poorly have understood an exact sense of problem. There are no
> problems with using pointers manipulation routines in CINs (certainly
> if you use correct values of arguments). However arrays are passed to
> CIN via handles and if you want to manipulate with sizes of these
> arrays you should use SetCINArraySize or NumericArrayResize routines.
>
> If you could send a small C code illustrating the trouble, I would
have
> more possibilities to help you.
>
> Regards,
> Kostya.
>
> In article <8lqarr$855$1@nnrp1.deja.com>,
> eugenekim@my-deja.com wrote:
> > hello
> >
> > i'm having trouble with arrays, pointers, and releasing them in
CINs..
> First
> > off, i'm following the example in the Code Interface Reference
Manual
> 2-18
> > (pg 70). In this example, they manipulate arrays by having a
pointer
> point
> > to the first element of the array that the handle it pointing to:
> float32
> > *aElmtp; aElmtp = (*ah) -> arg1; (where ah is the name of the handle
> of the
> > array being passed into a CIN)
> >
> > I did this and it seemed to work for a while but then i kept on
> getting
> > Application errors in windows NT. It said that it couldn't write to
> a memory
> > space that it was referencing. Later on, i saw on 5-10 pg 121
> of the same
> > manual that DSNewPtr would help out if there were memory problems..
> this
> > works fine except now the program crashes whenever i try to use
> DSDisposePtr
> > to release the pointers.. and if i don't use it, the program crashes
> every so
> > often because the memory gets full.. I'm passing in 3 arrays into
the
> CIN and
> > therefore creating and trying to dispose of 3 pointers. i debugged
> the CIN
> > and it crashed every time at the DSDisposePtr. can anyone help? i
am
> using
> > Labview 5.1.1 in Windows NT. Thank you for your input.
> >
> > Eugene Kim
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.