9 January 2009

Font choice -> dumb bug

Oh wonderful. I thought I was doing something seriously wrong whilst trying to record sound. WaveInOpen takes a flag value, I wanted to specify that it should callback a function and read it as:

#define CALLBACK_FUNCTION   0x000300001

where it is actually

#define CALLBACK_FUNCTION   0x00030000l 

Big difference eh. 1 vs L. The L specifies a C Long (32 bit integer).

I ended up sending two flags then, 0x300000 and 0x1. 0x1 tells it to just query - "can the device be opened" - without actually opening it. 0x300000 isn't defined. In testing it did call my callback function about 1 time in 3, the other 2 times it just crashed without error. So I though it was because I was doing the wrong thing in the callback. Argh.

No comments:

Post a comment