
15 Sep
2006
15 Sep
'06
12:07 p.m.
Hi! I try to export a Haskell function to VBA. (At the moment without COM.) Because VBA seems to expect a String with length information I tried to return a CStringLen as defined in Foreign.C.String. But if I try to compile it I get an "unacceptable argument type in foreign declaration: CStringLen". My reduced test program now is a strange "Hallo world!" program:
module Test where import Foreign.C.String
foreign export stdcall hello :: IO CStringLen hello :: IO CStringLen hello = do newCStringLen ("Hallo world!")
Do I do some thing wrong here? (If I use CString instead of CStringLen and accordingly newCString instead of newCStringLen everything compiles fine but VBA crashes.) Any help is appreciated, Andreas