V
voidtwerp
Am I being really stupid here - I cant see what the problem is.
how can I be getting different values in coincount and count? (note
that I dont think either is correct but I cannot be sure at this
stage).
// 3rd party dll header file
extern "C" {
APIDLL_EXPORT bool _cdecl ENGINE_GetCoinCount(uint CoinValue,ulong*
cnt);
}
// my .cpp file
void Help_ProductSale_CountCoins(uint coinvalue[],ulong coincount[])
{
ulong count;
for(int i=6;i--
{
ENGINE_GetCoinCount(coinvalue,&coincount);
ENGINE_GetCoinCount(coinvalue,&count);
printf("Count %d: %d (%d)\r\n",i,coincount,count);
}
}
bool Test_ProductSale()
{
uint coinvalue[]={5,10,20,50,100,200};
ulong coinstart[6];
Help_ProductSale_CountCoins(coinvalue,coinstart);
}
output:
Count 5: 0 (0)
Count 4: 0 (0)
Count 3: 0 (0)
Count 2: 235138746 (0)
Count 1: 5 (0)
Count 0: 60597997 (0)
how can I be getting different values in coincount and count? (note
that I dont think either is correct but I cannot be sure at this
stage).
// 3rd party dll header file
extern "C" {
APIDLL_EXPORT bool _cdecl ENGINE_GetCoinCount(uint CoinValue,ulong*
cnt);
}
// my .cpp file
void Help_ProductSale_CountCoins(uint coinvalue[],ulong coincount[])
{
ulong count;
for(int i=6;i--
{
ENGINE_GetCoinCount(coinvalue,&coincount);
ENGINE_GetCoinCount(coinvalue,&count);
printf("Count %d: %d (%d)\r\n",i,coincount,count);
}
}
bool Test_ProductSale()
{
uint coinvalue[]={5,10,20,50,100,200};
ulong coinstart[6];
Help_ProductSale_CountCoins(coinvalue,coinstart);
}
output:
Count 5: 0 (0)
Count 4: 0 (0)
Count 3: 0 (0)
Count 2: 235138746 (0)
Count 1: 5 (0)
Count 0: 60597997 (0)