Can not update user status onmain dialog

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,



I am trying to convert a console pjsua app into an MFC application(learning
VC++ along the way).



My application is working with all the functionality. But I am not able to
update the status for the registartion, call information etc. on the
softphone?s main dialog itself.

So, I change the static member function use for callback to non-static using
a static wrapper function.



But whenever I try to update the content of edit-control in the main dialog,
it gives error.



Following is the coding in my program



/*********** CPhoneDlg.h************/

#include <pjsua-lib/pjsua.h>

CPhoneDlg::public CDialog

{

??????????????

Public:

void on_reg(pjsua_acc_id acc_id);

static void wrapper_to_on_reg(pjsua_acc_id acc_id)

???????..

CString m_info;

}



/************ CPhoneDlg.cpp ***********/

#include "CPhoneDlg.h"

void *pObj;

/************ Callback called by the library when registration status has
changed ***********/

void CPhoneDlg::on_reg_state(pjsua_acc_id acc_id)

{

      ---do some stuff----



/** Now update the registration status on CPhoneDlg?s main dialog, m_info is
the edit-control?s value variable on CPhoneDlg?s

main dialog ******/

     m_userinfo=L?User status updated?;

//When I call the Update data, it gives a break point

//calling UpdateData before DoModal()?

     UpdateData(false);

}



void CPhoneDlg::wrapper_to_on_reg(????????)

{

      CPhoneDlg* pPhone = (CPhoneDlg*)pObj;

      pPhone->on_reg(acc_id);

}



BOOL CPhoneDlg::OnInitDialog()

{

CPhoneDlg phoneDlg;

pObj =(void*)&phoneDlg;



????????????????

pjsua_config cfg;

??????????????



// implement and override the on_reg_state in pjsua_config

cfg.cb.on_reg_state = &CPhoneDlg::wrapper_to_on_reg;

---------------------------

?????????????????.

}





I am badly stuck in this, please help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090421/1fd29323/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux