Page 1 of 1

Problem with short* ?

Posted: Sun Feb 20, 2005 11:47 am
by WolfgangS
Hi !
I have a problem with a wrapped function:
In C people use the function this way:

Code: Select all

    short* vChunk1 = libNanoSID_GenerateNextChunk(pSIDChip);
The include file...

Code: Select all

short*         libNanoSID_GenerateNextChunk(void* pSIDChip); 
I Wrapped the function this way:

Code: Select all

extern short* _stdcall PB_libNanoSID_GenerateNextChunk(void* pSIDChip)
{
	return libNanoSID_GenerateNextChunk(pSIDChip);
} 
I try to user the wrapped function in Purebasic this way:

Code: Select all

chunk=libNanoSID_GenerateNextChunk(pSIDChip)
but every time i call the function my program crashes exactly at this function. the paramater is 100% ok. Does anyone see a fault ? :(

Thank you + MFG
WolfgangS

Edit:
And this is the important part from the .desc file:

Code: Select all

libNanoSID_GenerateNextChunk, Long (pSIDChip.l) - Generates next chunk and returns the synthetized waveform 
Long

Posted: Sun Feb 20, 2005 8:12 pm
by Inner
chunk=libNanoSID_GenerateNextChunk(pSIDChip)

because pSIDChip is a void *, you need to give it a pointer to pSIDChip.