Re: [Haskell-cafe] Why am I not allowed to use CStringLen inforeignexport?

2006-09-22 Thread Andreas Marth
Thanks a lot for this information it helped a lot. Because I use the VBA 6 version the string characters are supposed to be a byte so I changed your code to type BSTR8 = Ptr Word8 createBSTR8 :: String - IO BSTR8 createBSTR8 s = do let len :: Word32 = fromIntegral (length s) low_l

[Haskell-cafe] Re: [newbie] How to test this function?

2006-09-22 Thread Jón Fairbairn
Bruno Martínez [EMAIL PROTECTED] writes: On Thu, 21 Sep 2006 15:12:07 -0300, Benjamin Franksen [EMAIL PROTECTED] wrote: OK. Thanks. I didn't find that one because it's not offered as an identation option in emacs haskell mode. Emacs is evil! That's a great exaggeration I'm open

[Haskell-cafe] Haskell DLL crashes Excel

2006-09-22 Thread Andreas Marth
Hi everybody! As you might now already know I try to let VBA call Haskell via a DLL. The function returns a String. Everything works fine now if I call the function only once. If I call it more often Excel crashes soon. Does any body have any idea what is going wrong or how I can find out. (I am

Re: [Haskell-cafe] Haskell DLL crashes Excel

2006-09-22 Thread Kyra
Andreas Marth wrote: type BSTR8 = Ptr Word8 createBSTR8 :: String - IO BSTR8 createBSTR8 s = do let len :: Word32 = fromIntegral (length s) low_l :: Word8 = fromIntegral (len .. 0x) low_h :: Word8 = fromIntegral (shiftR len 8 .. 0x) high_l :: Word8 = fromIntegral

Re: [Haskell-cafe] Re: [newbie] How to test this function?

2006-09-22 Thread Johan Tibell
If there's a problem with haskell emacs mode, it seems very likely that if you ask the maintainer nicely, he'll do something about it. See http://www.iro.umontreal.ca/~monnier/elisp/#haskell-mode I asked Stefan a while ago: I like your Emacs mode but it behaves a bit oddly when trying to

Re: [Haskell-cafe] Haskore

2006-09-22 Thread Henning Thielemann
On Fri, 22 Sep 2006, David Curran wrote: Hi I have been trying to learn haskell (tip over the vending machine) for a while and eventually decided the Haskore music library might be a good way to start understating the language. Please, don't understate this language! ;-) I am using

Re: [Haskell-cafe] Haskell DLL crashes Excel

2006-09-22 Thread Kyra
Kyra wrote: Use SysAllocString... family. Also, remember they (by convention) have to be released from the client side. Oops, they = such allocated BSTRs. Cheers, Kyra ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Re: [newbie] How to test this function?

2006-09-22 Thread Jón Fairbairn
Johan Tibell [EMAIL PROTECTED] writes: If there's a problem with haskell emacs mode, it seems very likely that if you ask the maintainer nicely, he'll do something about it. See http://www.iro.umontreal.ca/~monnier/elisp/#haskell-mode I asked Stefan a while ago: I like your Emacs

[Haskell-cafe] Re: Haskore

2006-09-22 Thread Jón Fairbairn
David Curran [EMAIL PROTECTED] writes: Hi I have been trying to learn haskell (tip over the vending machine) Tipping over a vending machine is a real world effect, so you'll have to use the IO Monad. -- Jón Fairbairn [EMAIL PROTECTED]

Re: [Haskell-cafe] Haskore

2006-09-22 Thread Bulat Ziganshin
Hello David, Friday, September 22, 2006, 1:40:31 PM, you wrote: openBinaryFile :: FilePath - IOMode - IO Handle import System.IO writeBinaryFile :: FilePath - String - IO () writeBinaryFile f txt = bracket (openBinaryFile f WriteMode) hClose

Re: [Haskell-cafe] Haskore

2006-09-22 Thread Paul Hudak
As Henning points out, the darcs version of Haskore is now the standard, which Henning has been kind enough to set up. However, it has also been extended and re-organized, and at least currently does not have the simplistic feel of the original Haskore. On the other hand, the version that is

Re: [Haskell-cafe] Haskore microtonal support

2006-09-22 Thread Paul Hudak
An easier and better way to support microtonal music in Haskore is to use the csound back-end instead of MIDI. I'd be happy to help someone develop such a thing if interested. -Paul Magnus Jonsson wrote: On Thu, 14 Sep 2006, Henning Thielemann wrote: On Thu, 14 Sep 2006, Magnus

[Haskell-cafe] Re: Haskel DLL crashes Excel

2006-09-22 Thread Cyril Schmidt
Andreas Marth wrote: As you might now already know I try to let VBA call Haskell via a DLL. I had to do this a while ago; the best I could come up with was: 1. Make a Haskell DLL that exports plain C-style interface. 2. With Visual Studio, make a COM DLL that exports the interfaces to be used

Re: [Haskell-cafe] Why am I not allowed to use CStringLen inforeignexport?

2006-09-22 Thread Brian Hulley
Andreas Marth wrote: Thanks a lot for this information it helped a lot. Glad to be of help. I am thinking about creating a wikipage about Haskell-VBA interfacing through a DLL. Is it okay for you if I put your code there? Yes. I am a bit concerned about the memory. newArray states that