Liang Weike wrote:
> Hello Carsten,
> 
> Sorry for my being not familiar with Basic.
> 
> So I want to use C++ language to make a debugging program.Just as I
> mentioned it to you at the last IRC meeting that the
> method"createMessageBox" was an api,how should I write the header when I
> make the program? You know, the compiler would visit the header
> file"vclxtoolkit.hxx",but it included such lines as "#include
> <com/sun/star/beans/PropertyAttribute.hpp>" when the compiler would show
> "can not open the directory".Therefore I felt puzzled how to write the
> header.Could you please give me instructions?
Hi Liang Weike,

You don't need to include vclxtoolkit.hxx it's an internal header of the
toolkit project and not necessary for you. You have to include the
following headers

#include <com/sun/star/awt/XMessageBoxFactory.hpp>

and create the toolkit service with the Office service manager.

See the following code snippet (xServiceManager is a reference to the
Office service manager).

...
#include <com/sun/star/awt/XMessageBoxFactory.hpp>
...

using namespace ::com::sun::star;

uno::Reference< awt::XMessageBoxFactory > xMsgBoxFactory(
xServiceManager->createInstance( rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" )),
uno::UNO_QUERY );
if ( xMsgBoxFactory.is() )
{
    uno::Reference< awt::XMessageBox > xMsgBox;
    xMsgBox = xMgsBoxFactory->createMessageBox( ... );
    ...

Regards,
Carsten

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to