Problems with API and VB IDE/Compiler
Posted on 2003-03-10
I have the following situation:
1. I have made a usercontrol using VB.
2. The usercontrol uses timeSetEvent API function like so:
m_hTmr = timeSetEvent(50, 5, AddressOf pTimerProc, &H0&, PERIODIC + CALLBACK_FUNCTION)
-.The pTimerProc is a procedure, declared in a Module in this project.
-.The pTimerProc refers back to the properties of the UserControl.
3. Everything works just fine while I'm testing it in the VB IDE.
When I compile the source and test it, it crashes with "illegal operation" error.
The error comes out exactly when the timer "clicks"
I've heard that there are problems when implementing multi-threading in VB.
Is this the problem here, and how can I solve it?