Chuck Messenger wrote:
> John Bandhauer wrote:
>
>> And your idl looks like...?
>
>
>
> [scriptable, uuid(C0AFBF5D-8607-4033-9BD7-F84C745CFF49)]
> interface sfIGameset : nsISupports
> {
> boolean Open(in string path, out string errStr);
> boolean Close();
> };
>
>
>> Where does it crash.
>
>
>
> It crashes in some thread which has no corresonding source code. The
> stack shows as only 2 deep -- assembler. So, no clues...
>
> The problem must be very straightforward and basic -- I've got the
> barest minimum of code in my DLL. I keep wondering if I've allocated
> the string memory correctly. Is it correct to return something I got
> from PL_strdup as an "out string" value? Or is there some special way I
> need to allocate memory for this?
Try using the nsAllocator class - eg nsAllocator::Clone() should be used
instead of PL_strdup.
> Another question: are there any particular compiler flags I need to use
> for my DLL? I'm on a Windows platform.
If possible, you should try and use the makefile.win system used by
Mozilla - then the flags are taken care of for you. I *suspect* that
you are seeing a crash as you did not use /Md (or /MDd for debug builds)
meaning your code and xpcom itself were using different CRTL heaps.
Mark