I'm integrating with an SDK from my VB .net application. One of the function call requires passing a BSTR and structure pointer. It also has two other parameters that are enumerations. I don't know the datatype for these Enumerations. How do I make the call. My code is someting like this:
Dim lChannel As New SmIa.SInputChannel
Dim lStructSize As Integer
lStructSize = Marshal.SizeOf(GetType(SmIa.SInputChannel))
With lChannel
.bw = SmIa.Bandwidth.bwBroad
.res = SmIa.Resolution.reHigh
.type = SmIa.InputChannelId.icMicrophone
End With
Dim lPtr As IntPtr = Marshal.AllocHGlobal(lStructSize)
Marshal.StructureToPtr(lChannel, lPtr, False)
Dim lResChannel As SmIa.SInputChannel = CType(Marshal.PtrToStructure(lPtr, GetType(SmIa.SInputChannel)), SmIa.SInputChannel)
Dim lStrUser As String = "r"
Dim lStrPtr As IntPtr = Marshal.StringToBSTR(lStrUser)
Dim lResUserName As String = Marshal.PtrToStringBSTR(lStrPtr)
Dim lLang As Integer = SmIa.LanguageId.lngUK
cTraining.Open(lResUserName, lResChannel, lLang, lLang)
Marshal.FreeBSTR(lStrPtr)
Of these SmIa.SInputChannel, SmIa.LanguageId are the structure and enum from the SDK.
Thanks for the help in advance