Ravi Dronamraju wrote:
Benjamin Smedberg wrote:
Ravi Dronamraju wrote:
I tried niky's instructions and went forward. Here's what i observed

1) xpcom.dll is not under dist/lib but under dist/bin
2) If i used that xpcom.dll to compile it fails with this error "c:\mozilla\dist\bin\xpcom.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x2B8"

You cannot link against DLLs on Windows, you have to link against the matching import library xpcom.lib.

--BDS

thanks for the advice, one more hurdle crossed and now i am falling forward at another one.

I discovered that I am required have a derived class from nsIDirectoryServiceProvider to do ns_InitEmbedding. I created that class. Now, It seems that i cannot create a CString and cast it to nsCString. Is there a trick to it?

error C2440: '<function-style-cast>' : cannot convert from 'wchar_t *' to 'nsCString_external'

-ravi
Try something like this:

//Converts UTF16 to UTF8
char *pSomePointer = (char*) NS_ConvertUTF16toUTF8 (sValue).get ();     

//Converts UTF8 to UTF16
sValue.Assign (NS_ConvertUTF8toUTF16 (szSomeString));

I'm not sure if there is a "better" way of doing it, but it seems to work fine for me, Good Luck!

Niky Williams
_______________________________________________
dev-embedding mailing list
dev-embedding@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to