PDA

View Full Version : بدست آوردن قابلیت های مودم توسط KDTELE



smt_414
دوشنبه 26 فروردین 1387, 12:52 عصر
سلام
شاید به نظر تکراری بیاد
و جواب شما این باشه که جستجو کن تو بخشی دلفی هست توی خود kdtele کلی نمونه به زبان ویژوال بیسیک هست و داخل help خودش کد به زبان سی شارپ هست و از اینطور جوابها

این سوال قبلا مطرح شده بود و به جواب هم نرسیده بود
تا اینکه در طرح ادغام فرم ها به دلیل به جواب نرسیدن حذف شد

برای اینکه برای پاسخ دادن زیاد هم به مشکل بر نخورید قطعه کد خود kdtele به زبان ویژوال بیسیک رو اینجا میذارم
البته توسط سایت های تبدیل کد وی بی به سی شارپ هم تبدیلش کردم اما باز هم جواب نداد
امیدوارم
دوستان این بار لطفشون شامل این سوال بشه



Private Sub ComboBoxLines_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBoxLines.SelectedIndexChanged
Dim lvLineCaps As KDTele.TxLineCaps
Dim lvRet As Int32

TextBoxLineCaps.Text = ""
lvRet = KDPhoneControl.GetLineCaps(ComboBoxLines.SelectedI ndex, lvLineCaps)
If lvRet <> 0 Then
TextBoxLineCaps.Text = "Error: " + KDPhoneControl.GetErrorMsg(lvRet)
Exit Sub
End If

If KDTele.TxLineCaps.lcCallerID And lvLineCaps Then
TextBoxLineCaps.Text += "Caller ID - OK" + vbCrLf
Else
TextBoxLineCaps.Text += "Caller ID - UNAVAILABLE" + vbCrLf
End If

If KDTele.TxLineCaps.lcDigitPulseDetect And lvLineCaps Then
TextBoxLineCaps.Text += "Digit pulse detection - OK" + vbCrLf
Else
TextBoxLineCaps.Text += "Digit pulse detection - UNAVAILABLE" + vbCrLf
End If

If KDTele.TxLineCaps.lcDigitToneDetect And lvLineCaps Then
TextBoxLineCaps.Text += "Digit tone detection - OK" + vbCrLf
Else
TextBoxLineCaps.Text += "Digit tone detection - UNAVAILABLE" + vbCrLf
End If

If KDTele.TxLineCaps.lcWavePlayRec And lvLineCaps Then
TextBoxLineCaps.Text += "Play and record wave - OK" + vbCrLf
Else
TextBoxLineCaps.Text += "Play and record wave - UNAVAILABLE" + vbCrLf
End If

If KDTele.TxLineCaps.lcDataDevice And lvLineCaps Then
TextBoxLineCaps.Text += "Serial port device - OK" + vbCrLf
Else
TextBoxLineCaps.Text += "Serial port device - UNAVAILABLE" + vbCrLf
End If

If KDTele.TxLineCaps.lcExtDevAux And lvLineCaps Then
TextBoxLineCaps.Text += "Auxiliary microphone and speaker capabilities:" + vbCrLf

If KDTele.TxLineCaps.lcExtDevAuxMicOnSpeakerOff And lvLineCaps Then
TextBoxLineCaps.Text += " -Turning on the mic only - OK" + vbCrLf
Else
TextBoxLineCaps.Text += " -Turning on the mic only - UNAVAILABLE" + vbCrLf
End If

If KDTele.TxLineCaps.lcExtDevAuxMicOffSpeakerOn And lvLineCaps Then
TextBoxLineCaps.Text += " -Turning on the speaker only - OK" + vbCrLf
Else
TextBoxLineCaps.Text += " -Turning on the speaker only - UNAVAILABLE" + vbCrLf
End If

If KDTele.TxLineCaps.lcExtDevAuxMicOnSpeakerOn And lvLineCaps Then
TextBoxLineCaps.Text += " -Turning on the microphone and the speaker simultaneously - OK" + vbCrLf
Else
TextBoxLineCaps.Text += " -Turning on the microphone and the speaker simultaneously - UNAVAILABLE" + vbCrLf
End If

If KDTele.TxLineCaps.lcExtDevAuxMicGain And lvLineCaps Then
TextBoxLineCaps.Text += " -Mic gain adjusting - OK" + vbCrLf
Else
TextBoxLineCaps.Text += " -Mic gain adjusting - UNAVAILABLE" + vbCrLf
End If

If KDTele.TxLineCaps.lcExtDevAuxSpeakerVolume And lvLineCaps Then
TextBoxLineCaps.Text += " -Speaker volume adjusting - OK" + vbCrLf
Else
TextBoxLineCaps.Text += " -Speaker volume adjusting - UNAVAILABLE" + vbCrLf
End If
Else
TextBoxLineCaps.Text += "Auxiliary microphone and speaker - UNAVAILABLE" + vbCrLf
End If

If KDTele.TxLineCaps.lcExtDevHandset And lvLineCaps Then
TextBoxLineCaps.Text += "Local phone handset capabilities:" + vbCrLf

If KDTele.TxLineCaps.lcExtDevHandsetMicOnSpeakerOff And lvLineCaps Then
TextBoxLineCaps.Text += " -Turning on the mic only - OK" + vbCrLf
Else
TextBoxLineCaps.Text += " -Turning on the mic only - UNAVAILABLE" + vbCrLf
End If

If KDTele.TxLineCaps.lcExtDevHandsetMicOffSpeakerOn And lvLineCaps Then
TextBoxLineCaps.Text += " -Turning on the speaker only - OK" + vbCrLf
Else
TextBoxLineCaps.Text += " -Turning on the speaker only - UNAVAILABLE" + vbCrLf
End If

If KDTele.TxLineCaps.lcExtDevHandsetMicOnSpeakerOn And lvLineCaps Then
TextBoxLineCaps.Text += " -Turning on the microphone and the speaker simultaneously - OK" + vbCrLf
Else
TextBoxLineCaps.Text += " -Turning on the microphone and the speaker simultaneously - UNAVAILABLE" + vbCrLf
End If

If KDTele.TxLineCaps.lcExtDevHandsetMicGain And lvLineCaps Then
TextBoxLineCaps.Text += " -Mic gain adjusting - OK" + vbCrLf
Else
TextBoxLineCaps.Text += " -Mic gain adjusting - UNAVAILABLE" + vbCrLf
End If

If KDTele.TxLineCaps.lcExtDevHandsetSpeakerVolume And lvLineCaps Then
TextBoxLineCaps.Text += " -Speaker volume adjusting - OK" + vbCrLf
Else
TextBoxLineCaps.Text += " -Speaker volume adjusting - UNAVAILABLE" + vbCrLf
End If
Else
TextBoxLineCaps.Text += "Local phone handset - UNAVAILABLE" + vbCrLf
End If
End Sub

با تشکر

smt_414
دوشنبه 26 فروردین 1387, 18:51 عصر
سلام
با عذر خواهی از دوستان
جواب این سوال اهمیت زیادی داره :چشمک:

smt_414
چهارشنبه 28 فروردین 1387, 11:04 صبح
سلام
شاید دوستان اون کد طولانی تاپیک اول رو می بینند و از جواب دادن منصرف می شن
کد رو به سی شارپ تبدیل کردم تا دوستان کد و خطا رو با هم مشاهده کنند
شاید فرجی شد


KDTele.TxLineCaps lvLineCaps;
Int32 lvRet;
lvRet = axKDPhone1.GetLineCaps(0, lvLineCaps);


The best overloaded method match for 'AxKDTele.AxKDPhone.GetLineCaps(int, ref int)' has some invalid arguments
Argument '2': cannot convert from 'KDTele.TxLineCaps' to 'ref int'

البته داخل خود sample های kdtele به زبان وی بی برای این قطعه کد یک warning میده !
Implicit conversion from 'Integer' to 'KDTele.TxLineCaps' in copying the value of 'ByRef' parameter 'lineCaps' back to the matching argument.

موفق باشید