pIdisp is not vtable itself, but a pointer to this one. So, this code works:

(let* ([vtable (ptr-ref pIdisp _pointer)]
[addref (ptr-ref vtable (_fun #:abi 'stdcall _com-interface -> _uint) 1)] [release (ptr-ref vtable (_fun #:abi 'stdcall _com-interface -> _uint) 2)])
 (addref pIdisp)
 ...
 (release pIdisp))

Thanks for help!

----- Original Message ----- From: Ben Goetter <goet...@mazama.net>
To: Kovalev Yuriy <yos...@mail.ru>
Cc: dev@racket-lang.org
Subject: Re: [racket-dev] Calling virtual functions

To dig into that vtable, use ptr-ref.  Don't forget to pass the
interface back to the method as its first parameter.

Following is untested.  Not even paren-balanced.

(let ((addref (ptr-ref pIdisp (_fun #:abi 'stdcall _com-interface ->
_uint) 1))
       (release (ptr-ref pIdisp (_fun #:abi 'stdcall _com-interface ->
_uint) 2)))
 (addref pIdisp)
 ...
 (release pIdisp))


_________________________________________________
 For list-related administrative tasks:
 http://lists.racket-lang.org/listinfo/dev

Reply via email to