Doug Turner wrote:
Yes, I want it. I want to this interface become a system level service -- such as provide a method as NS_GetStringService(), and can call this method before NS_InitXPCOM2().
the nsIStringService is not complete or active. If you require this class, lets talk about it. I was going to enable it, but i had some second thoughts.
In this way, there is no need for me to implement nsAString and nsACString. As "string" and "wstring" have well defined binary format, I can always create "string" and "wstring", then use nsIStringService to convert from/to nsAString and nsACString.
As I haven't touched C/C++ for a long time, so I try to use C/C++ as little as possible. Also, I expect XPCOM more like a binary protocol, same as COM/OLE, do not limit on the language that implement it. That is, for any language that provide language level or API level ability to manage the binary layout of things, should be able to use XPCOM. To my case, swt provided a set of native APIs that enable me to manipulate memory, so I can construct/convert memory block conform to the "string"/"wstring" format. Also, I can call XPCOM objects using the vtbl format. Further more, swt also provide mechanism to receive vtbl incomming calls and map to java method, this will enable me to write COM object implementation in Java code. The three things enable swt to manipuate COM/OLE, I think this three thing should also enable me to manipuate XPCOM.So my question here is: how can I get an nsIStringService? What must I do before I be able to get it? Must I use nsAString or nsACString before I get nsIStringService?
In your code, you are going to have to implement the AString/ACString. \Take a look at the nsEmbedString and nsEmbedCString in mozilla/xpcom/glue/standalone. This is a very simple class that implements the abstract string classes.
Unfortunately, after I be able to list all the registered components (this only require me to use "string", no need for nsACString"), I don't know how could I manipulate "nsACString".
If I can get nsIStringService, then I can work around nsAString.
So far, seemed I must write more C/C++ code and write my own nsAString implementation. The hardest thing then is how to set up the environment. Do I need to download all the mozilla source code and get it compiled? Or there is a set of lib file and .h file that I can download and include in my C++ project? Is there any sample or document how to set up a VC6.0 project for this?
Doug Turner [EMAIL PROTECTED]
Thanks jml
