Problem with short* ?

Just starting out? Need help? Post your questions and find answers here.
WolfgangS
Enthusiast
Enthusiast
Posts: 174
Joined: Fri Apr 25, 2003 3:30 pm

Problem with short* ?

Post 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
WolfgangS' projects http://www.schliess.net
Quotation of the month:
<p3hicy>oder ich hol mir so eine geile aus asien
<p3hicy>die ständig poppen will
<p3hicy>'n brötchen pro tag reicht doch
<p3hicy>die essen eh' nich so viel
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Post by Inner »

chunk=libNanoSID_GenerateNextChunk(pSIDChip)

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