Lescher Christian <[EMAIL PROTECTED]> writes:
> 
> Thanks a lot for your solution! However, I've got two more problems:
> 
> 1) When executing "make", I get an error message.
> 
> C:\...>make
> /ghc/ghc-4.08.1/bin/ghc-4.08.1 -static -package lang -c BSTR.hs
> C:/ghc/ghc-4.08.1/lib/includes/Stg.h:141: stdlib.h: No such  file or
directory
....

I've seen this too - cygwin is playing games with mounting. From
within bash, do 

  mount c:\\cygwin\\usr\\include /usr/include
  # or wherever you've got cygwin installed.

and type 'make' again. (I assume you're using a release of cygwin1.1.
If not, then something else is up.)

> 
> 2) The test code in "Main.hs" calls freeBSTR, in order to 
> free memory space, I suppose.
> Isn't something like that also necessary in the uppercase 
> example function (for usage within a DLL)?
> 

Remember that the Haskell function is being called here, so
normal rules for transfer of memory management responsibilities
still applies. i.e., a function/method is not responsible for
releasing/freeing any of its arguments(*), irrespective
of what language the function is implemented in.

So, any BSTRs you receive as arguments will be freed by the
caller (VBA), and any BSTRs you return as results will also
be freed by the caller. 

--sigbjorn
 
* - unless it's an [in,out] parameter in IDL-speak, but that's not
    the case here.

Reply via email to