AW: Using Haskell code in VBA (MS Access)?

Lescher Christian christian.lescher@icn.siemens.de
Fri, 20 Oct 2000 13:04:03 +0200


I tried to compile this small example with ghc-4.08.1, but it didn't =
work (compiling ok., but DLL does not run), while with ghc-4.05 =
everything is okay. What can be wrong with this?

Christian Lescher

> -----Urspr> =FCngliche Nachricht-----
> Von:	Sigbjorn Finne [SMTP:sof@microsoft.com]
> Gesendet am:	Donnerstag, 17. August 2000 20:18
> An:	'Christian Lescher'
> Cc:	glasgow-haskell-users@haskell.org
> Betreff:	RE: Using Haskell code in VBA (MS Access)?
>=20
>=20
> The support libraries for HaskellDirect provide
> functions for converting between BSTRs and Haskell'
> String (Com.marshallBSTR, Com.unmarshallBSTR) --
> http://www.dcs.gla.ac.uk/fp/software/hdirect/user-32.html
>=20
> has the overview. However, the binaries available for
> that library is for ghc-4.045, so you'd have to compile
> them up yourself for ghc-4.08.
>=20
> To build a 'static' DLL, here's what you need to do:
>=20
> - compile up all your Haskell code using -static.
> - write a .def file containing the entry points you
>   want to expose. In my example, the .def file would
>   just contain:
>=20
>       EXPORTS
>          adder@8
>=20
> - link the static DLL:
>=20
>      ghc-4.05 -static --mk-dll -optdll--def=3Dadder.def \
>           -o adder.dll adder.o dllMain.o -lHSrts
>=20
> I heard some rumours that -static might disappear. If that's
> the case, I think that would be unfortunate.
>=20
> --sigbjorn
>=20
> Christian Lescher <christian@lescher.de> writes:
> >=20
> > Thank you for your detailed answer - it's really great, it works! =
:-)
> >=20
> > However, I have got one more problem: the function I want to=20
> > call from VBA is of
> > type String -> String -> String
> > Is there a (simple) method to convert VBA strings (BSTR) to=20
> > Haskell's [Char] and
> > vice versa?
> >=20
> > By the way: Is it possible to build DLLs that do not depend=20
> > on GHC's runtime DLLs?
> > I tried out the "-static" option like for compiling EXEs, but=20
> > it didn't work.
> >=20
> > CL
> >=20
> >=20
>=20