Log in

View Full Version : Skype & VB6


TSM
19-01-07, 10:50 AM
Has anyone done any work with VB6 + Skype.

I am trying to attach the Skype4COM API but its not working. Any ideas. Im not brill at VB6, just trying to make a dinky app.

TSM
19-01-07, 10:57 AM
Has anyone done any work with VB6 + Skype.

I am trying to attach the Skype4COM API but its not working. Any ideas. Im not brill at VB6, just trying to make a dinky app.

This might not sound helpful, but why not try downloading the free version of Visual Studio .NET and using VB.NET (or C#, even better!) - might find it easier (or harder) ?

Lee.

I thought about it, but some of our apps are already VB6 and this would be an addon when ive got it working.

thor
19-01-07, 10:58 AM
VB6 is ****. It's very old.

TSM
19-01-07, 11:06 AM
Yeh we have old apps that i alone cant convert.

Baph
19-01-07, 11:11 AM
Not sure if you ONLY want to attach, but I figure if you're wanting to attach, you'll be wanting to do other stuff later. Apologies if I'm showing you how to suck an egg. Attach() happens in Form_Load below:

Public WithEvents Skype1 As SKYPE4COMLib.Skype
Public SkypeCall As SKYPE4COMLib.Call
Public CommandId As Integer

Private Sub CallButton_Click()
Set SkypeCall = Skype1.PlaceCall("echo123")
End Sub

Private Sub Form_Load()
Set Skype1 = New SKYPE4COMLib.Skype
Skype1.Attach (5)
CommandId = 1
End Sub

Private Sub StartRecordingButton_Click()
CommandId = CommandId + 1
Dim CommandText As String
CommandText = "ALTER CALL " & SkypeCall.Id & " SET_OUTPUT FILE=" & Chr$(34) & "C:\skype.wav" & Chr$(34)
Dim CommandObj
Set CommandObj = Skype1.Command(CommandId, CommandText)
Skype1.SendCommand (CommandObj)
End Sub

Private Sub StopRecordingButton_Click()
CommandId = CommandId + 1
Dim CommandText As String
CommandText = "ALTER CALL " & SkypeCall.Id & " SET_OUTPUT"
Dim CommandObj
Set CommandObj = Skype1.Command(CommandId, CommandText)
Skype1.SendCommand (CommandObj)
End Sub

Private Sub Skype1_Command(ByVal pCommand As SKYPE4COMLib.ICommand)
Debug.Print "C>" & pCommand.Command
End Sub

Private Sub Skype1_Reply(ByVal pCommand As SKYPE4COMLib.ICommand)
Debug.Print "R>" & pCommand.Reply
End Sub

In case you're wondering, attach parameter (5) is the version of the protocol, 5 is default, but you have to specify it still IIRC.

HTH

TSM
19-01-07, 01:04 PM
Cool all done now.

I could not get the recording part of your code to work but would have been brill if it did, anyway what i needed to work is now working.

muffles
19-01-07, 01:09 PM
VB6 is sh*t. It's very old.

<nods>

and it's been end of life for about 2 years hasn't it!?

that said, we're still using it for one part of our system, time/cost/imminent large changes to our system mean upgrading isn't worthwhile...

Baph
19-01-07, 01:13 PM
Cool all done now.

I could not get the recording part of your code to work but would have been brill if it did, anyway what i needed to work is now working.

Good good, glad it helped. Not my code, just something I found in our CVS tree. Give me a shout if there's other stuff you find (in pretty much any language) difficult to get run because of an odd problem. We have a pretty extensive source in CVS ;)