Click here to Skip to main content
15,886,691 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ahh,its so bad a week,i can't get the way. Plz,someone help .

i create a simple object using atl(vs2005).code like:

DWORD WINAPI IPEventProc( LPVOID lpParameter)
{
   OVERLAPPED overlap;
   DWORD ret;
   HANDLE handle;
   handle=NULL;
   overlap.hEvent = WSACreateEvent();
   ret = NotifyAddrChange(&handle, &overlap);
   if(WaitForSingleObject(overlap.hEvent, INFINITE) == WAIT_OBJECT_0 )	
   {
      //here trigger event
      Fire_IPChange(L"darling , i'm coming...");

   }
   
}
StartNotifyAddrChange(VARIANT_BOOL* bSucc)
{
  ...
  CreateThread(NULL,0,IPEventProc,0,CREATE_SUSPENDED,&tid);
  SetThreadPriority(tHandle,THREAD_PRIORITY_IDLE);
  ResumeThread(tHandle);
  ...
}


when i  use this object in  c#,it has this problem:
//deal the ip change event 
void ipobj_IPChange(string para)
{        
            
      MessageBox.Show(s);              //the first line
      textBox14.Text = "change";       //the second line             
            
}

when ip changed ,the first line can run correctly. but the second line runs nothing ,just nothing happend ,why ?

when only the first line ,it's ok!

when only the second line ,it's not work.

Please,give me some advice.
Posted
Updated 29-Dec-11 16:01pm
v2

1 solution

Hi,

If it is c++, simply use

Messagebox(s);
GetDlgItem(IDC_EDIT_BOX)->SetWindowText(_T("Change"));


Cheers,
 
Share this answer
 
Comments
china.net 1-Jan-12 6:10am    
no,its VB & C# ,how can i? And why ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900