I have a scriptable Win32 XPCOM plugin with a method that returns a wstring. 
If I call this method in a script in Firefox 1.5, I get an type error that 
it is not a function. The method uses nsMemory::Clone to allocate the 
returned string. Mozilla versions up to Firefox 1.5 can call the method 
successfully

If I modify the method so that it only sets the string to null and returns, 
the script shows that the string is null.

If I modify it further so that it just _mentions_ nsMemory, Firefox cannot 
find the function. Specifically, I add the statement "void *p = 
nsMemory::Clone;"

According to the person who created the plugin, it is using the Gecko 1.7 
SDK. I don't know what the linking strategy is; the plugin is linked with 
xpcom.lib and no other Gecko libraries. I have tried linking against 
xpcomglue.lib and xpcomglue_s.lib with no improvements. The plugin was 
derived from the Mozilla scriptable plugin example. I am building it with 
Visual Studio.

I'm baffled that changing something inside a function would make it 
impossible to call that function, and I hope that someone can make sense of 
it and point me in the right direction. Thank you.

Myles



_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to