Using a Linked Sound Recorder Object with OLECLIEN.VBXLast reviewed: June 21, 1995Article ID: Q87768 |
The information in this article applies to:
SUMMARYThe following program demonstrates the use of the Microsoft Visual Basic OLECLIEN.VBX custom control to create a linked Sound Recorder object. The following OLEClient property settings are required to create a Sound OLE object:
Setting Definition
-------------------------------------------------------------------
Class - "SoundRec"
SourceDoc - The full path of the "wave" file to use (for example:
C:\WINDOWS\CHIMES.WAV)
SourceItem - The type of sound file object. "Wave" is the only
sound format supported by the Windows operating
system version 3.1 Sound Recorder.
NOTE: Sound Recorder does not come with Microsoft Windows version 3.0. You
must have Windows version 3.1 to use this example. You must also have a
computer capable of playing wave audio sounds (.WAV files). If you do not
have a sound board, you can obtain a Windows sound driver for your PC
Speaker. For information on obtaining this driver, query on the following
words in the Microsoft Knowledge Base:
win31 and driver and speak.exe MORE INFORMATIONThe following program demonstrates how to create a linked Sound Recorder object in Microsoft Visual Basic for Windows by using the OLECLIEN.VBX custom control:
Step-by-Step Example1. Start Visual Basic or from the File menu, choose New Project (ALT, F, N)if Visual Basic is already running. Form1 is created by default.
Sub Command1_Click ()
OLEClient1.Class = "SoundRec"
OLEClient1.Protocol = "StdFileEditing"
OLEClient1.SourceDoc = "c:\windows\chimes.wav"
' Source Item for Sound Recorder is 'Wave', but
' Sound Recorder does not check this property so
' any value will do.
OLEClient1.SourceItem = "Wave"
OLEClient1.ServerType = 0 ' Linked.
OLEClient1.Action = 1 ' CreateFromFile.
Command1.Enabled = 0
End Sub
Sub OleClient1_DblClick ()
OLEClient1.Action = 7 ' Activate (open for editing).
End Sub
Sub Form_Unload (Cancel As Integer)
OLEClient1.Action = 9 ' Close (terminate connection).
End Sub
REFERENCES"Microsoft Professional Toolkit for Visual Basic: Custom Control Reference," pages 196-232
|
Additional reference words: 1.00 2.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |