Of
| Andreas Marth
| Sent: 22 September 2006 10:21
| To: haskell-cafe@haskell.org
| Subject: [Haskell-cafe] Haskell DLL crashes Excel
|
| 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
L PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
| Andreas Marth
| Sent: 22 September 2006 10:21
| To: haskell-cafe@haskell.org
| Subject: [Haskell-cafe] Haskell DLL crashes Excel
|
| Hi everybody!
|
| As you might now already know I try to let VBA call Haskell via a DLL.
The
| function returns
Andreas Marth wrote:
I solved this with adding C:\WINNT\system32\oleaut32.dll to the files the
linker shold link.
Was that correct?
I prefer "-loleaut32" but see no big difference.
Because this dll crashes Excel instantly. I used the code suggested by Esa
Ilari Vuokko:
newtype BSTR = BSTR CWS
Hi Kyra!
First thanks for your repeated responses.
I tried to use SysAllocString as suggested by you and Esa Ilari Vuokko.
Unfortuntly I get an error: "fake: undefined reference to
[EMAIL PROTECTED]"
from the linker if I use "stdcall" (wich I think I should use) or fake:
undefined reference to `
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
http://www.haskell.org/
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 = fromIntegr
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 a