All,
Following Chris Young's advice I switched my call to include the
pascal statement, and as an extra measure decided to just go ahead and
store the second variable into the array and eliminate the extra
overhead and confusion of passing two parameters (Thanks, Chris) and
return a value to determine that the proper values are being passed.
*** c-code ******************
pascal long main(long *NotesMain) //NotesMain is the array pointer
{
long Notes;
SysBeep(30); // this tells me I made it this far
for (Notes = 0; Notes <= 30; Notes++)
{
//SysBeep(30);
gcrNoteRestDur[Notes] = NotesMain[Notes];
}
SysBeep(30); // this tells me I made it this far
...
return gcrNoteRestDur[1];
}
******************************
*** FB Code ******************
CALL "DCOD", 1935 ,Returnvalue& , (@gNoteRestDur&(0))
print Returnvalue&
******************************
Now, when I run this from FB it works fine and the print Returnvalue&
line prints exactly what I sent in the second element of the array to
the c-code and my routine plays exactly the quicktime notes that I
sent to it. The problem comes when I build the application and run it.
When the c-code is called I get the first sysbeep() followed by a Type
1 error dialog. If I uncomment the sysbeep() in the loop it will beep
the first iteration and then I get the dialog for the type 1 error.
Somehow the first assignment of array values causes this error. I have
ensured that all the array slots are set to 0 in FB before I make the
call.
Chris, any ideas?
Robert Price
Programmer/Technical Support
support@...