|
To fellow ILEersYou exactly nailed it. type_ds is "automatic" storage, meaning it is allocated when $obcGetType is called and released when $obcGetType returns. Once it returns, you have no idea what is occupying that memory space. You must never return a pointer to your local storage to an outside routine.
I'm trying to use a pointer to a data structure to pass data back from a
sub procedure. I had it working at one point but have since made some
changes and now it doesn't work. What's happening is $obcGetType loads
the data structure properly and the pointer is getting passed back to
$obcSelect, however the data in the 'type' data structure in $obSelect
is garbage. It's almost like once $obcGetType goes out of scope the
memory for type_ds gets corrupted. Any suggestions?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.