-
Notifications
You must be signed in to change notification settings - Fork 0
/
ComDllMain.hs
28 lines (25 loc) · 902 Bytes
/
ComDllMain.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{-# OPTIONS -#include "ComDllMain_stub.h" #-}
-----------------------------------------------------------------------------
-- |
-- Module : ComDllMain
-- Copyright : (c) Sigbjorn Finne, sof@forkIO.com 1999-2009
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : sof@forkIO.com
-- Stability : provisional
-- Portability : portable
--
-- The 'main-Main' to link with when building a DLL containing
-- a Haskell in-proc COM component.
--
-----------------------------------------------------------------------------
module ComDllMain where
import Main ( comComponents )
import ComDll ( createIComDll )
import Com ( putMessage )
import Foreign.Ptr
newComDll :: Ptr () -> IO (Ptr (Ptr ()))
newComDll handle = do
(ip,_) <- createIComDll handle comComponents
return ip
foreign export ccall "newComDll" newComDll :: Ptr () -> IO (Ptr (Ptr ()))