Hi Andre,

Andre Heine escribió:
Hello Ariel,

I'm some steps higher:-)

But something strange happens...

I can compile your demo but I can see the string in the XCell ("This works!")
only two times. All other runs of the demo bring OOo to hang;()

Without any modifications on the source!

The same in my code...

The code, that cause the "hanging":

------ snip
Reference< XComponent > rEmbeddedObjectComponent = rEmbeddedObjectSupplier->getEmbeddedObject();
------

strange... the example is a C++ (in C style ;-) ) version of the same
example in Java and OOo Basic (quite the same you were trying to
translate). And for me works in the 3 versions.

XEmbeddedObjectSupplier / XEmbeddedObjectSupplier2 are supported by
::com::sun::star::text::TextEmbeddedObject, so at least getting the
reference and using XEmbeddedObjectSupplier::getEmbeddedObject() and
XEmbeddedObjectSupplier2::getExtendedControlOverEmbeddedObject() *must*
work; what I didn't mention you (as I didn't want to complicate your
things) is that XEmbeddedObjectSupplier::getEmbeddedObject() may return
a null reference because some embedded objects have no component, z.B.
Java Applets - in this case you must use
XEmbeddedObjectSupplier2::getExtendedControlOverEmbeddedObject().
But when you embedded an office document, you have a component and a
model, so getEmbeddedObject() returns it.

Nevetherless, they *both* (getEmbeddedObject() and
getExtendedControlOverEmbeddedObject() ) *must* work, although  - as
said - one may return null.

And they both are "published interfaces"; don't ask me since when,
because I have no idea, but they are used in the Dev's Guide examples,
which - in general rule - are quite old.

Did you try with other embedded objects? For example, use
"078B7ABA-54FC-457F-8551-6147e776a997" for an OOo Math formula,
"12dcae26-281f-416f-a234-c3086127382e" for an OOo Chart.

Thanks to you, checking one again the Dev's Guide, I discovered an
example in
http://api.openoffice.org/docs/DevelopersGuide/Text/Text.xhtml#1_3_10_3_Embedded_Objects


that is not included in the SDK examples.
A preliminary C++ version can be found at

http://www.ArielConstenlaHaile.com.ar/ooo/temp/TextTableChart_cpp.zip

Try it and see what happens when embedding Chart instead of Calc (here
at least in Linux and Windows worked).

May be your problem is in/with your OOo/SDK installation:
I'm using OOoSDK2.0 and OOo 2.0.4 on suse linux 10.2...
May be, my SDK or linux is broken...

I am using openSUSE 10.3 (i586) (kernel 2.6.22.16-0.2-default i686) with
OOo 2.3.1 and SDK 2.3 (they both compiled by OOo == not downloaded from
SuSe repositories).


I got following warning from "ld":

/usr/bin/ld: warning: libstdc++.so.6, needed by /opt/openoffice.org2.0/program/libcppu.so, may conflict with libstdc++.so.5

if it is in /opt/openoffice.org I guess its OOo's build, not Suse's ...

I ignore that, it's generally a problem in our project. We must use
for some libs libstdc++.so.5;-\

The comic is, that the code works in some cases without any modifications.
When OOo hangs I must kill all "soffice.bin" manually.
At this time I'm very confused, but I don't surrender:-)

as I can't find anything wrong on the code [though may be some else
reading this can ;-) more eyes can see more!], I assume may be something
is wrong with your software.

Can't you update to OOo 2.3.1 and SDK 2.3? Did you try if you can build
it/run it on Windows? (on Win XP with MS Visual C++ Express 2005 I had
no problem).


Concerning the libraries error, a few weeks ago someone asked me about a
very similar problem, but I couldn't find any solution: when trying to
run the example on
/opt/openoffice.org2.3_sdk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_cpp/
he got linking errors (quite similar to yours), the first one:

/opt/openoffice.org2.3/program/libstdc++.so.6: version `GLIBCXX_3.4.9'
not found (required by _SimpleBootstrap_cpp)
make: *** [SimpleBootstrap_cpp.run] Error 1

All proposals and corrections (symlinks missing, old libraries, etc)
didn't work.
May be it's related, and may be some one as a clue. Me, I was very lucky
compiling with the SDK from the beginning - well ... I had my days of
headache trying to make things work, sure that's why Java seems to be
the easy way.

Regards
Ariel.


--
Ariel Constenla-Haile
La Plata, Argentina

[EMAIL PROTECTED]
[EMAIL PROTECTED]

http://www.ArielConstenlaHaile.com.ar/ooo/



"Aus der Kriegsschule des Lebens
                - Was mich nicht umbringt,
        macht mich härter."
                Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.





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

Reply via email to