Click here to Skip to main content
15,894,405 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Producer - Consumer Issue Pin
toxcct21-Mar-07 7:07
toxcct21-Mar-07 7:07 
GeneralRe: Producer - Consumer Issue Pin
godspeed12321-Mar-07 7:17
godspeed12321-Mar-07 7:17 
GeneralRe: Producer - Consumer Issue Pin
toxcct21-Mar-07 7:29
toxcct21-Mar-07 7:29 
AnswerRe: Producer - Consumer Issue Pin
Nemanja Trifunovic21-Mar-07 7:14
Nemanja Trifunovic21-Mar-07 7:14 
GeneralRe: Producer - Consumer Issue Pin
godspeed12321-Mar-07 7:18
godspeed12321-Mar-07 7:18 
GeneralRe: Producer - Consumer Issue Pin
Nemanja Trifunovic21-Mar-07 7:27
Nemanja Trifunovic21-Mar-07 7:27 
AnswerRe: Producer - Consumer Issue Pin
Eytukan21-Mar-07 7:31
Eytukan21-Mar-07 7:31 
QuestionDll callback and MFC help [modified] Pin
Van Ly Doc Hanh21-Mar-07 6:01
Van Ly Doc Hanh21-Mar-07 6:01 
Hi,

I'm writing a MFC application with callback dll functions, but it's have the problem with the callback function and mfc. I have two callback functions: OnInviteResult and OnLoginResult are called by a function in a dll. The first function OnLoginResult works fine, but OnInviteResult make the program halt when it execute the line:
pdlg->m_status.ReplaceSel("Connected\r\n");

I have debuged and seen pdlg pointer has the same address in both OnLoginResult and OnInviteResult functions.
Below is my code:
TestDLLDlg.cpp
CTestDLLDlg* pdlg; // pointer to Dialog used by callback functions to update info
.....

CTestDLLDlg::CTestDLLDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTestDLLDlg::IDD, pParent)
{
  m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
  pdlg = this;
}
......
void CALLBACK OnLoginResult(int *registered)
{
  switch (*registered){
  case 1:
    pdlg->m_status.ReplaceSel("Registered\r\n");
    break;
  case 2:
    pdlg->m_status.ReplaceSel("Invalid Username or Password\r\n");
    break;
  case 3:
    pdlg->m_status.ReplaceSel("Service Unavaiable\r\n");
    break;
  }
}
void CALLBACK OnInviteResult(int *status)
{
  switch (*status){
    case 1:
      pdlg->m_status.ReplaceSel("Ringing...\r\n");
      break;
    case 2:
      pdlg->m_status.ReplaceSel("Connected\r\n");
      break;
    case 3:
      pdlg->m_status.ReplaceSel("Hung up\r\n");
      break;
    default:
      break;
  }
}
int CTestDLLDlg::SetCallbackFunctions(void)
{
    SetCallbackLogin(OnLoginResult);
    SetCallbackInvite(OnInviteResult);
    return 0;
}


Do you have any idea about this problem?
Any help would be appreciated.

DBQ.




-- modified at 17:31 Wednesday 21st March, 2007
QuestionRe: Dll callback and MFC help Pin
David Crow21-Mar-07 6:40
David Crow21-Mar-07 6:40 
AnswerRe: Dll callback and MFC help Pin
Van Ly Doc Hanh21-Mar-07 6:45
Van Ly Doc Hanh21-Mar-07 6:45 
GeneralRe: Dll callback and MFC help Pin
David Crow21-Mar-07 6:47
David Crow21-Mar-07 6:47 
GeneralRe: Dll callback and MFC help [modified] Pin
Van Ly Doc Hanh21-Mar-07 7:18
Van Ly Doc Hanh21-Mar-07 7:18 
AnswerRe: Dll callback and MFC help Pin
Eytukan21-Mar-07 7:26
Eytukan21-Mar-07 7:26 
GeneralRe: Dll callback and MFC help Pin
Laxman Auti21-Mar-07 6:51
Laxman Auti21-Mar-07 6:51 
QuestionDialog box message map entry Pin
GruenerSchreibtisch21-Mar-07 5:58
GruenerSchreibtisch21-Mar-07 5:58 
AnswerRe: Dialog box message map entry Pin
David Crow21-Mar-07 6:36
David Crow21-Mar-07 6:36 
QuestionWhat type of dll do i need for a Cold Fusion app to use Pin
LCI21-Mar-07 5:55
LCI21-Mar-07 5:55 
QuestionTCP/IP port marshalling (forwarding) Pin
agulbays21-Mar-07 5:11
agulbays21-Mar-07 5:11 
QuestionRe: TCP/IP port marshalling (forwarding) Pin
Mark Salsbery21-Mar-07 6:55
Mark Salsbery21-Mar-07 6:55 
AnswerRe: TCP/IP port marshalling (forwarding) Pin
agulbays21-Mar-07 7:10
agulbays21-Mar-07 7:10 
GeneralRe: TCP/IP port marshalling (forwarding) Pin
Mark Salsbery21-Mar-07 7:48
Mark Salsbery21-Mar-07 7:48 
GeneralRe: TCP/IP port marshalling (forwarding) Pin
agulbays21-Mar-07 20:44
agulbays21-Mar-07 20:44 
GeneralRe: TCP/IP port marshalling (forwarding) Pin
Mark Salsbery22-Mar-07 6:52
Mark Salsbery22-Mar-07 6:52 
GeneralRe: TCP/IP port marshalling (forwarding)-THANX -this problem IS OVER Pin
agulbays22-Mar-07 0:53
agulbays22-Mar-07 0:53 
Questionstatic variables in stdafx.h Pin
werpa21-Mar-07 5:07
werpa21-Mar-07 5:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.