I have the following code running in a QT application (QLC) but I’m getting some strange results - it seems like my integer is being overwritten by a pointer. Also, if I make the variables volatile, my pointers get overwritten instead so I’m no better off. Any ideas?
I’ve tried using the original DLL supplied and also the DLL (and exe) I found on this forum dated 07/06/2010 11:16.
int channelCount = universe.size();
SetChannelCount(channelCount);
unsigned char value = 0;
int channelLoop = 0;
while (channelLoop < channelCount)
{
qDebug("1. Channel: %d, %p, value: %d, %p, count: %d, %p", channelLoop, &channelLoop, value, &value, channelCount, &channelCount);
value = uchar(universe[channelLoop]);
qDebug("2. Channel: %d, %p, value: %d, %p, count: %d, %p", channelLoop, &channelLoop, value, &value, channelCount, &channelCount);
SetData(channelLoop, value);
qDebug("3. Channel: %d, %p, value: %d, %p, count: %d, %p", channelLoop, &channelLoop, value, &value, channelCount, &channelCount);
channelLoop++;
qDebug("4. Channel: %d, %p, value: %d, %p, count: %d, %p", channelLoop, &channelLoop, value, &value, channelCount, &channelCount);
}
Results in the following debug being written…
warning: 1. Channel: 0, 0xd93fe8c, value: 0, 0xd93fe93, count: 512, 0xd93fe94
warning: 2. Channel: 0, 0xd93fe8c, value: 0, 0xd93fe93, count: 512, 0xd93fe94
warning: 3. Channel: 0, 0xd93fe8c, value: 0, 0xd93fe93, count: 512, 0xd93fe94
warning: 4. Channel: 227802773, 0xd93fe8c, value: 0, 0xd93fe93, count: 512, 0xd93fe94
227802773 = 0xd93fe95