OLE-Objekt

Hallo,

ich wollte mit einem OLE-Objekt eine WAV Datei in mein Programm einfügen und ich wollte fragen, wie man dieses Objekt ansteuern kann, also ich bräuchte Befehle wie man z.B. Die Musikdatei automatisch beim aufruf abspielen lässt oder sie wieder zu stoppen. Kenn mich noch nicht so gut VB aus. Danke schonmal für eure Hilfe.

MfG, Alex

Hallo,

ich wollte mit einem OLE-Objekt

mit OLE-Objekten kenne ich mich nicht aus.

eine WAV Datei in mein
Programm einfügen und ich wollte fragen, wie man dieses Objekt
ansteuern kann, also ich bräuchte Befehle wie man z.B. Die
Musikdatei automatisch beim aufruf abspielen lässt oder sie
wieder zu stoppen. Kenn mich noch nicht so gut VB aus.

Das würde ich lieber über die API erledigen. Man kann auch den Mediaplayer einbinden, aber der verwendet dann auch nur die API. :smile:

Private Const SND\_APPLICATION = &H80 ' look for application specific association
Private Const SND\_ALIAS = &H10000 ' name is a WIN.INI [sounds] entry
Private Const SND\_ALIAS\_ID = &H110000 ' name is a WIN.INI [sounds] entry identifier
Private Const SND\_ASYNC = &H1 ' play asynchronously
Private Const SND\_FILENAME = &H20000 ' name is a file name
Private Const SND\_LOOP = &H8 ' loop the sound until next sndPlaySound
Private Const SND\_MEMORY = &H4 ' lpszSoundName points to a memory file
Private Const SND\_NODEFAULT = &H2 ' silence not default, if sound not found
Private Const SND\_NOSTOP = &H10 ' don't stop any currently playing sound
Private Const SND\_NOWAIT = &H2000 ' don't wait if the driver is busy
Private Const SND\_PURGE = &H40 ' purge non-static events for task
Private Const SND\_RESOURCE = &H40004 ' name is a resource name or atom
Private Const SND\_SYNC = &H0 ' play synchronously (default)
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Sub Form\_Load()
 'KPD-Team 2000
 'URL: http://www.allapi.net/
 'E-Mail: [email protected]
 PlaySound "C:\WINDOWS\MEDIA\TADA.WAV", ByVal 0&, SND\_FILENAME Or SND\_ASYNC
End Sub

Gruß, Rainer