Hi, this is the example code I ma trying to execute....
SIPX_INST tInst;
SIPX_LINE tLine;
SIPX_CALL tCall, tempCall;
void phone::registerButton_Click(System::Object^ sender, System::EventArgs^ e)
{
registerExt();
}
void phone::registerExt()
{
temp1 = extTextBox->Text;
temp2 = proxyTextBox->Text;
temp1= temp1 + "@" + temp2;
regExt = (char*)System::Runtime::InteropServices::Marshal:: StringToHGlobalAnsi(temp1).ToPointer();
if(SIPX_RESULT_SUCCESS != sipxInitialize(&tInst,
DEFAULT_UDP_PORT,
DEFAULT_TCP_PORT,
DEFAULT_TLS_PORT,
DEFAULT_RTP_START_PORT,
DEFAULT_CONNECTIONS,
regExt,
NULL,
true))
{
eventTextBox->Text = "Initialize Fail!!!";
}
else
eventTextBox->Text = "Initialize Success!!!";
if(SIPX_RESULT_SUCCESS != sipxLineAdd(tInst, regExt, &tLine))
eventTextBox->Text = "Line Add Fail!!!";
else
eventTextBox->Text->Concat("Line Add Success!!!");
if(SIPX_RESULT_SUCCESS != sipxLineRegister(tLine, true))
{
MessageBox::Show("Error Registering !!!", "Registration Notification");
eventTextBox->Text = "Register Error!!!";
}
else
{
MessageBox::Show("Registration Success !!!", "Registration Notification");
eventTextBox->Text = "Registered Successfully !!!";
EventListener(tInst);
}
}
Now, let me explain the code above.
I am using and unmanaged C code. i.e, a .lib, .dll and .h file that is written in unmanaged C. I am trying to use these with a managed C++ windows forms application.
The problem that I seem to be facing is that, when I declare the variable SIPX_INST tInst, withing the register(), I am able to "Watch" the value for the tInst variable during debugging.
But when its declared as in the code above, the "Watch" says, error:identifier 'tInst' out of scope. And also I am not able to pass the value to the eventListener() and use it any further in the program, even though the variable is declared as global.
can anyone help? Thank You in advance!!!!