[racket] Com Service with ffi

From: heraklea at gmx.de (heraklea at gmx.de)
Date: Thu Oct 11 05:28:19 EDT 2012

So far so good:
(define _ULONG _ulong)
(define _CATID _GUID)
(define _REFCATID _GUID-pointer)
(define-cstruct _CATEGORYINFO ( [catid _CATID]
                                [lcid _LCID]
                                [szDescription (_array _short 128)])) 
(define IID_ICustomList
            (string->iid "{3039E12D-6CEF-4F91-AE9B-E609481C8824}"))
(define CustomList (com-create-instance "MySrv.CustomList.1"))

(define-com-interface (_ICustomList _IUnknown)
    ([Next/ci (_mfun (_ULONG = 1)
                 (catinfo : (_ptr o _CATEGORYINFO))
                (got : (_ptr o _ULONG))
                -> (r : _HRESULT)
                -> (cond
                [(zero? r) catinfo]
                [(= r 1) #f]
                [else (windows-error "Next/ci
    failed" r)]))]
        [Skip _fpointer]
        [Reset _fpointer]
        [Clone _fpointer])) 

(define icat (QueryInterface (com-object-get-iunknown CustomList)
                               IID_ICustomList
                               _ICustomList-pointer))

But I dont understand your third suggestion. lets assume my Interface have a method CallMe(...). How do I implement it and call it after.

I assume you mean this part:
(define-com-interface (_ICatInformation _IUnknown)
  ([EnumCategories (_hmfun _LCID
                           (p : (_ptr o _IEnumCATEGORYINFO-pointer))
                           -> EnumCategories p)]


with EnumCategories as method??


Yours,

Posted on the users mailing list.