The Access Violation Error

Discussion of I-CubeX applications and use. Post here questions about your project, product suggestions, bugs, setup issues, ..

Moderator: Tech

Post Reply
RiderChips
Posts: 1
Joined: Tue Feb 10, 2009 10:42 am
I-CubeX gear: USB-microDig

The Access Violation Error

Post by RiderChips » Tue Feb 10, 2009 11:44 am

I used the function "setSensor(int nSensorNbr, bool bOn)" in ICubeLib library to turn on sensors from 1 to 8. I always got an access violation error during the execution time of my program. A part of my code is shown below:

void CMyApp::OnBnClickedStart()
{
initICubeXLib();
openPort(eUSB_MIDIdig, 0, true);
BYTE sxHostMode[] = { 0xF0, 0x7D, 0x0, 0x5A, 0x00, 0xF7 };
.(sxHostMode, sizeof(sxHostMode));
setInterval(300);
for (int i = 0; i < 8; i++)
{
setSensor(i, true);
}
SetTimer(1001, 300, NULL);
}

My program always got an access violation error in the line "setSensor(i, true);". The error message is "0xC0000005: Access Violation, write of address 0x009b0008". I went to call stack windows in Visual C++ and got information below:

ICubeXLib.dll!10007231()

I think maybe it is a bug in ICubeXLib.DLL. How should I solve this problem!?

Thanks a lot!

Post Reply