INTERACT FORUM
Windows => Plug-in Development => Topic started by: KingSparta on August 24, 2002, 06:16:37 am
-
if i put the program in a for next loop, and you click out of plug-ins back into MJ the program crashes.
Is there away to exit gracefully when in a loop?
In Private Sub UserControl_Terminate()
MyLoop = List1(0).ListCount
this does not seem to work and it crashes MJ when you click out of plug-ins
-
any ideas on how to keep it from crashing MJ?
is this a code problem or MJ problem?
I would think MJ would terminate it for me or at least not crash.
-
Try putting some error handling in your loop.
Wonder if that would work.
-
Well Not Really...
Run-time error'-2147417848 (80010108)':
Automation error
The object invoked has disconnected from its clients
Then
Media Jukebox Application Error
The instruction at "0x212f2070" referenced memory at "0x212f2070". The memory could not be "read".
Click OK to terminate the program.
when you do it closes MJ
-
hmm, try putting a DoEvents in your loop. I wonder if that will fix it.
-
DoEvents are in there.
For myloop = MyPosition To List1(0).ListCount - 1
List1(0).ListIndex = myloop
List1(0).SetFocus
DoEvents
CommandLookUp_Click
DoEvents
Next myloop
-
Does it crash right away, or does it wait 5 seconds or so?
And what happens without the DoEvents(...)?
Thanks.
-Matt
-
>> Does it crash right away, or does it wait 5 seconds or so?
It waits a few seconds maybe 5
> And what happens without the DoEvents(...)?
Same thing, crash
I think i will make a ocx with a loop in it do a call to a sub with really nothing in it and see what happens.
I am wondering if it has something to do with the stack
-
maybe try a different type of loop?
maybe try a different type of loop?
maybe try a different type of loop?
maybe try a different type of loop?
maybe try a different type of loop?
maybe try a different type of loop?
maybe try a different type of loop?
maybe try a different type of loop?
maybe try a different type of loop?
maybe try a different type of loop?
maybe try a different type of loop?
-
You Sound Like Your Repeating Your Self
Step 1: Turn Off Power
Step 2: Count To 10
Step 3: Turn On Power
Besides can you recommend one that does not crash?
I have not tested a plain loop yet, so not sure if thats it.
-
Does your OCX get a "Terminate" call somewhere in there? (MJ calls the function Terminate if it exists before releasing a control)
If so, make a handler to break out of your loops or wait until they're done on Terminate.
If Terminate doesn't get called, we'll keep thinking.
-Matt
-
>> Does your OCX get a "Terminate"
it did but removed it i did not think it was helping..
it could be i just did not do it correctly.
i will look at that again.