MCI Control Gets Into a Tizzy - Done Events Not Being Generated 
Author Message
 MCI Control Gets Into a Tizzy - Done Events Not Being Generated

I'm writing a program (VB 4.0  Win 3.11) that uses a multimedia MCI
Control to play WAVe and MIDi files.  The program uses two forms.  The
main (frmMain) form displays a digital clock and is used to load sound
schedules and display the status of the file currently playing.  This
form also has a menu control on it.

The second form (frmEditGroup) has the MCI control on it. It is loaded
when the Edit|Edit Group menu command is selected from the main form
using the statement: frmEditGroup.Show.  I can play all of my files
just fine, and Done events are generated as expected when the program
is run for the first time.  However, when I exit the program, and then
run it again, no DONE events are generated.  The only way to get the
done events  generated is to shut VB down and restart it.

This is how I exit the program:

While on the second form (the one with the MCI control) I click the
Exit button.  This causes the following statement to be executed:
frmEditGroup.Hide, thus preserving variables related to that form, and
returning me to the main form.

On the main form, I click on File|Exit.  The following lines of code
are executed:

frmEditGroup.MMControl1.Wait = True
frmEditGroup.MMControl1.Command = "Close"
Close
End

When I run the program again, the MCI_Done events don't get generated.
Am I not managing the MCI resources properly.  These actions obviously
put the MCI control in a state of confusion.

Please also note that if you click the stop button on the VB tool-bar
or if you double-click the control menu bar on the main form as a
means to end the program, the MCI control gets confused here as well.
I would almost expect this to happen though, because I don't have any
code in the forms unload event that would take care of the MCI
control.  Also, I would have thought that when you re-start a program,
the MCI control would be initialized to some default behaviour. but
instead it seems to retain old values.  

After the problem occurred, I started playing with notify and wait
properties, but the control ignores them.  Also, as stated above, the
program runs as expected the first time through, so I must have these
properties set correctly.

If anyone has any clues as to what is taking place here, I would
appreciate it very much if you would pass them along.  Thanks.

Regards,

Michael E. Floyd
Saint John, NB  Canada

 P.S.  After writing this note, I put a frmEditGroup.Unload statement
in my main form's Unload event.  Now, the File|Exit command should
close the media player, and then the main form's unload event should
unload frmEditGroup.  Without unloading the second form, the programs
resources are chewing up memory (at least in EXE version).
Unfortunately, it didn't help me.



Tue, 29 Dec 1998 03:00:00 GMT  
 MCI Control Gets Into a Tizzy - Done Events Not Being Generated


Quote:

> On the main form, I click on File|Exit.  The following lines of code
> are executed:

> frmEditGroup.MMControl1.Wait = True
> frmEditGroup.MMControl1.Command = "Close"
> Close

  ~~~~~
 Remove this little fella

Quote:
> End

 _  _____  _   _

| || (_) || `\| | http://www.sn.no/~balchen/igloo/
| ||  _  || , ` |
| || | | || |`\ | If a train station is where a train
(_)(_) (_)(_) (_) stops, what is a workstation?


Wed, 30 Dec 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. MCI control doesn't generate DONE Event

2. Common Dialog and Timer Events/MCI Done Event

3. MCI done event

4. Using MCI (vb4-32): Done event and Dynamic Sizing

5. I am trying to update a record, i am not using data control

6. I am trying to update a record, i am not using data control

7. not getting events in IE4 from ActiveX Control written in VB5

8. textbox validate event not being fired when sstab controls gets focus

9. not getting events in IE4 from ActiveX Control written in VB5

10. ADO Data Control - What Am I Doing Wrong?

11. Will somebody tell me what I am doing wrong with this ListView Control

12. Referring to controls - What am I doing wrong???

 

 
Powered by phpBB® Forum Software