xSystemChildFactory->createSystemChild() hangs

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
arnavpoch
Posts: 2
Joined: Tue Oct 07, 2008 9:41 am

xSystemChildFactory->createSystemChild() hangs

Post by arnavpoch »

Hi,
I want to embed a OOo Window in a C++ Win32 application using the OOo SDK 2.4 (VS2008 SP1).
My limited ;) understanding of the doc and samples lead to the following preparative code:

Code: Select all

LRESULT Create(HWND hWndParent)
{
	// Error handling code removed for clarity
	Reference<XComponentContext> xComponentContext(::cppu::bootstrap());

	Reference<XMultiComponentFactory>xMultiComponentFactory(xComponentContext->getServiceManager());
	
	Reference<XInterface> xDesktop = xMultiComponentFactory->createInstanceWithContext(
		OUString::createFromAscii("com.sun.star.frame.Desktop"), xComponentContext);

	Reference< XComponentLoader > xComponentLoader(xDesktop, UNO_QUERY);
	
	Reference<XInterface> xToolkit = 
		m_xMultiComponentFactory->createInstanceWithContext(
		OUString::createFromAscii("com.sun.star.awt.Toolkit"), xComponentContext);

	Reference<XSystemChildFactory> xSystemChildFactory(xToolkit, UNO_QUERY);

	Any ahWnd((long)hWndParent);
	Sequence<sal_Int8> processID = 0;
	//CHAR processID[4] = {0};
	m_xWindowPeer = xSystemChildFactory->createSystemChild(ahWnd, processID,   
		com::sun::star::lang::SystemDependent::SYSTEM_WIN32);
	// ...
It compiles OK but the call to createSystemChild never returns, no exception is thrown either
If I break in the debugger I get a message that the app looks deadlocked, no user thread active.
The call stack at the break is:
kernel32.dll!769f77d4()
kernel32.dll!769f7742()
sal3.dll!62124805()
urp_uno.dll!5f38a651()
urp_uno.dll!5f38775a()
urp_uno.dll!5f38780c()
urp_uno.dll!5f38df47()
urp_uno.dll!5f38da65()
msci_uno.dll!63111428()
msci_uno.dll!63111a88()
msci_uno.dll!63111afb()
> OOoViewer.exe!WTL::OOo::Window::Create(HWND__ * hWndParent=) Line 128 + 0x39 bytes C++

Thanks for any help.

cheers,
AR
Post Reply