Martin Kretzschmar wrote:
Right. However, it is written in managed C++. That is, the UNO types it uses can be contained in C++ headers (C++ uno -binding). In your case, you do not have managed C++ and you do not have the UNO types as CLI types, because you want to create climaker (in C#) which is used to create these types. This is the hen and egg problem I spoke of.Am Mittwoch, den 09.02.2005, 17:52 +0100 schrieb Joachim Lingner:
With a working CLI UNO binding
+runtime environment, is it possible to rewrite climaker purely managed (e.g. in C#)?
Yes. You need however a bit of glue code. the mono cli_maker would be a C# executable. At program start it needs to bootstrap UNO, because it needs the type description provider server. This is achieved by calling into a native (C++) library, where UNO is bootstrapped.
Isn't that what cli_cppuhelper.dll is for...?
The C# function
would return a component context which can be further used to created the needed UNO services. For example in MS C# you could have something like:
[DllImport("CLI_UNO_Bootstrap.DLL", EntryPoint="getContext", CallingConvention=CallingConvention.StdCall)] public extern XComponentContext getContext( );
...and this would have to be done in a reimplementation of cli_cppuhelper (to replace native_bootstrap.cxx code)
As I indicated above, you need the respective CLI type. In particular the unoidl.com.sun.star.uno.XComponentContext interface, which is contained in cli_types.dll, which in turn was created by climaker.
The way I would go is to first determine if there is a C /C++ API in Mono which can be used to create and access CLI components from outside the runtime (similar to the Java JNI interface).
If this is possible, then make sure that the Emit API is fully functional. The last time I looked, which is many month back, that package was not implemented yet.
If the package is available, then you could write a C++ program in which you bootstrap UNO, obtain UNO type information through the type description provider service, and use the Emit classes throuch C/C++ to create the respective CLI types.
Seeing this I get first doubts, because you have a hen and egg problem here. The UNO interfaces which you need to get the UNO type information must be created first, for which the climaker is used :(
But you could use the mono runtime from a C++ program and use its C/C++ interface to use the emit framework. But you have to clarify first if such an interface exists at all. For MS there is only the cumbersume Automation interface (IDispatch).
If we however assume that mono IL code is compatible to MS IL code and the libraries have the same binary format (which could be but must not) then one could use the windows climaker to create the types assembly and just put the library into the Linux OO distribution.
The IL code should be the same, so one could take a Windows copy of cli_types.dll for bootstrapping.
+ cli_basetypes.dll Maybe there are some
compile-from-source zealots who will scream loudly, but I don't care.
Well that is quite an undertaking. Do not underestimate the work.
Heh. I know that climaker is not even the hard part.
Anyway, good luck with that.
Thanks,
Martin
Joachim
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
