Results 1 to 2 of 2

Thread: ActiveX, Safe 4 scripting & initialisation

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2000
    Posts
    31

    ActiveX, Safe 4 scripting & initialisation

    Hi everybody, I want to put this control up onto a webpage, and I want to make sure it is safe for scripting and initialisation and then eventually get it certified. This will be my first time to do this...It is a control were a person can record their voice using a mic..
    Can anybody who has gone through this process have a look and tell me,

    1. Is this control safe for scripting and initialisation?
    2. If not, how can I make it as safe as possible for a user to use?

    thanks
    Skat

    < the code>

    Private Sub MMControl1_PlayClick(Cancel As Integer)
    Dim CC

    CC = mciSendString("PLAY MYSOUND FROM 0 NOTIFY", 0&, 0, 0)

    Label1.Caption = "Play"
    Label3.Caption = ""
    Label2.Caption = ""

    Exit Sub

    End Sub

    Private Sub MMControl1_RecordClick(Cancel As Integer)

    Dim CC

    MySoundID = 0

    CC = mciSendString("CLOSE MYSOUND", 0&, 0, 0)

    CC = mciSendString("OPEN NEW TYPE WAVEAUDIO ALIAS MYSOUND", 0&, 0, 0)
    MySoundID = 0

    CC = mciSendString("set MYSOUND time format ms bitspersample 8 channels 1 samplespersec 11025", 0&, 0, 0)

    CC = mciSendString("RECORD MYSOUND NOTIFY", 0&, 0, 0)

    RecTimer.Enabled = True

    Label3.Caption = "Record"
    Label1.Caption = ""
    Label2.Caption = ""

    Exit Sub
    End Sub

    Private Sub MMControl1_StopClick(Cancel As Integer)
    Dim CC

    RecTimer.Enabled = False

    CC = mciSendString("STOP MYSOUND", 0&, 0, 0)

    CC = mciSendString("SEEK MYSOUND to start", 0&, 0, 0)

    Label2.Caption = "Stop"
    Label1.Caption = ""
    Label3.Caption = ""
    Exit Sub
    End Sub

    Private Sub RecTimer_Timer()
    Call MMControl1_StopClick(0)
    End Sub

    Private Sub UserControl_Initialize()
    '$ Set properties needed by MCI to open.
    MMControl1.Enabled = True
    MMControl1.Notify = True
    MMControl1.Wait = True
    MMControl1.Shareable = False
    MMControl1.DeviceType = "WaveAudio"

    '$ Open the MCI WaveAudio device.
    MMControl1.Command = "Open"
    End Sub

    Option Explicit

    '$Code added to use VB MCI control
    Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
    Last edited by skat; Dec 20th, 2001 at 12:09 PM.

  2. #2
    Fanatic Member Kzin's Avatar
    Join Date
    Dec 2000
    Posts
    611
    Are you still interested? I can give you some relevant info if you are
    Looking for a friendly intelligent chat forum? Visit the white-hart.net

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width