Link to home
Start Free TrialLog in
Avatar of metalfish
metalfish

asked on

XPCOM function returns nsAString

Can someone provide me an example to XPCOM function which has a return value as nsAString?

Thanks,

MF
ASKER CERTIFIED SOLUTION
Avatar of mrwad99
mrwad99
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of metalfish
metalfish

ASKER

Thanks. That works.

By the way, do you know how to convert .NET String to nsAString? Any example will be helpful.

MF
Glad to help.
>> By the way, do you know how to convert .NET String to nsAString? Any example will be helpful.
Without extensive research I cannot give you complete code to do this.  However, you can get a char* from a System.String (I assume that is what you mean when you say .NET string) by following the extensive advice here http://support.microsoft.com/kb/311259.  And according to https://developer.mozilla.org/en/XPCOM_string_guide, you can use nsDependentString to convert char* to nsAString(https://developer.mozilla.org/en/XPCOM_string_guide#Raw_Character_Pointers).  
HTH :o)
I will look into that. Thanks again for the help