Did you try
LstSetListChoices( listP, ( Char ** ) &(gGeodesics->datumNames), numDatums );
Luc Le Blanc wrote:
I am trying to setup a popup list from strings stored in a PDB file.
The PDB constains a single record with a struct:
typedef struct
{
....
Char datumNames[NumDatums][DatumNameLength];
} Geodesics;
filled like this:
const Geodesics gGeodesics =
{
/* 0 */ "Adindan",
/* 1 */ "Adindan Burkina Faso",
/* 2 */ "Adindan Cameroon",
/* 3 */ "Adindan Ethiopia",
/* 4 */ "Adindan Mali",
...
/* 202 */ "WGS 1984"
};
Then I open the PDB and lock the record:
gGeodesics = ( Geodesics * ) MemLocalIDToLockedPtr(appInfoID,card0);
and I setup the popup list:
LstSetListChoices( listP, ( Char ** ) gGeodesics->datumNames, numDatums );
In the CW 9.3 debugger I can see the string array, properly filled, but when
the list gets popped up in the form, I get a bus error: just read from memory
location 0x31393630.
What amd I doing wrong? I tried building a string array (do I have to?) with
SysFormPointerArrayToStrings but with no better results. And if i can avoid it,
it's a lot of heap memory saved.
Luc Le Blanc
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/