[omniORB] wxWidgets app hangs when corba call trys to load a new frame

Jason Dolan jason at pcc.com
Fri Mar 4 10:45:58 GMT 2005


I sent this to the wxWidgets list as well.....but honestly I'm not sure if its 
a wxWidgets issue or an omniORB issue...so I figured I'd post it here as 
well....

Hey guys, I have a bit of code I'm having an issue with.  The specs first:

Running wxWidgets-2.5.3 under WindowsXP with Cygwin.  Using wxWidgets in 
conjunction with OmniORB.

Here is my issue:

The App loads my main frame (myFrame) and writes some output to its text 
control.  The app sets up a Corba Thread that listens for in-comming 
communication from other applications. Then the app makes a call to another 
non-wxwidgets app on a different server via corba calls.  Then it waits for 
that app to call back to its corba thread.

When this other app calls back to the corba thread, the corba thread calls a 
myFrame member function.  This member function calls wxMutexGuiEnter() then 
it creates a new window then shows it then  calls wxMutexGuiLeave().

The issue is, it seams to enter the Mutex, load the frame (partially show it) 
then leave the mutex...but hangs somewhere in the process.  Are there any 
issues creating/loading a frame outside of the main GUI thread?

This same app seems to work under linux and Mac...  I'm not sure if this  is a 
wxWidgets/cygwin problem, and wxWidgets/Windows problem, omniorb/cygwin 
problem, or a omniorb/windows problem....  I'm pretty stumped.

Here is the function with the issues:

void app1Frame::SetXRC(CORBA::String_var strXRC, const char *baseFrame, const 
char *parentFrame)
{
 if (!::wxIsMainThread())
 {
  wxMutexGuiEnter();
  const char *bufXRC = (const char *) strXRC;
  
  std::ofstream fileOut("temp.xrc");
  fileOut << bufXRC;
  fileOut.close();
  
  wxString strTemp(bufXRC, wxConvUTF8);
  
  wxXmlResource::Get()->InitAllHandlers();
 
  wxXmlResource::Get()->Load(wxString(_("temp.xrc")));
  
  wxString strParentFrame(parentFrame,wxConvUTF8);
  wxString strBaseFrame(baseFrame,wxConvUTF8);
  
  m_pFrame = new MyFrame((wxWindow *) this);
  wxXmlResource::Get()->LoadFrame(m_pFrame, this, strBaseFrame);
   
  m_pFrame->Show(TRUE);

  wxMutexGuiLeave();
 }
}



More information about the omniORB-list mailing list