From: Babar S. <bab...@ya...> - 2004-04-22 14:01:25
|
Hello, Without DLL wrapping or COM based interface it is not possible to call iaxclient from VB. You have to create a DLL (Static or COM based) to call from VB. For old style DLL wrapping you have to call like this:- Private Declare Sub xxxx Lib "iaxclient" Alias "xxx" etc and from COM based project you can call :- Private Sub IaxClientOcx1_GetAudioDevices(ByVal Types As String, ByVal DeviceName As String) If Types = "INPUT" Then cmb_input_dev.AddItem DeviceName If Types = "OUTPUT" Then cmb_output_dev.AddItem DeviceName If Types = "RING" Then cmb_ring_dev.AddItem DeviceName End Sub Private Sub IaxClientOcx1_levels(ByVal input1 As Long, ByVal output1 As Long) 'write code to display levels in progress bar End Sub Private Sub IaxClientOcx1_Messages(ByVal Message As String) lbl_messages.Caption = Message End Sub Private Sub IaxClientOcx1_State(ByVal StateEvent As String) lbl_state.Caption = StateEvent End Sub etc... Date: Wed, 21 Apr 2004 09:27:27 -0400 From: Steve Kann To: Eloy Domingos CC: iax...@li... Subject: Re: [Iaxclient-devel] Creating iaxclient .dll for Borland C++ I think that several people are making DLLs from iaxclient, but they all use some kind of "glue" file to do it. As I understand it, it should be relatively straightforward to make the iaxclient library functions available when compiled to a DLL (while also making sure it can still compile to a static library with different options). The issue for some people (not for you), was that they didn't know how (or it may not be possible) to have Visual Basic access the union which we're currently using for events: typedef struct iaxc_event_struct { int type; union { struct iaxc_ev_levels levels; struct iaxc_ev_text text; struct iaxc_ev_call_state call; } ev; } iaxc_event; So, making the current API available to Visual Basic is problematic. We could add a couple of simple C functions to do the casting necessary, though. Basically something like this: struct iaxc_ev_levels *iaxc_extract_levels(struct iaxc_event struct *s) { return &(s->levels); } etc. This would allow VB programmers (I think) to get the union members without needing to figure out how to make VB access the union. If we do this, though, I'd like input from the VB and other DLL users though, so we can make a solution that works for everyone. -SteveK Eloy Domingos wrote: >Hi All, > > >I was wondering whether anyone has been able to successfully create >a win32 .dll file for Borland C++ enterprise developer, without altering >the iaxclient lib sources. If so, I would like to know how this was >achieved (project/unit settings, compiler/linker configuration). > >I have been able to use iaxclientlib with some success in my IAX2 >softphone client, but I had to modify the iaxclient lib and various >other libraries (gsm, speex, portaudio), in order to compile/link them into >my application. Instead of this, I would prefer a cleaner interface >between my application and the libiaxclient suite by compiling it into >a .dll (with typelib info). > >Any pointers or info will be appreciated. > > >Thanks in advance, >Eloy Domingos God is a great Programmer --------------------------------- Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢ |