Re: vTable offsets
From: Alexander Nickolov (agnickolov_at_mvps.org)
Date: 08/01/04
- Previous message: Mike H: "Re: vTable offsets"
- In reply to: Mike H: "Re: vTable offsets"
- Next in thread: Mike H: "Re: vTable offsets"
- Reply: Mike H: "Re: vTable offsets"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 31 Jul 2004 19:52:13 -0700
What about starting by posting the interface in question you are
referencing and the client code you used to obtain it? I suspect
you obtained a pure IDispatch* and tried to address it as a dual
interface, but this is a mere guess. At any rate, the problem is
somewhere with your perception not corresponding with the
reality. A dual interface doesn't have a gap in the vtable as you
are trying to explain it. Ah, details as the server type (in-proc vs
out-of-proc), threading model, etc might be of further help too.
-- ===================================== Alexander Nickolov Microsoft MVP [VC], MCSD email: agnickolov@mvps.org MVP VC FAQ: http://www.mvps.org/vcfaq ===================================== "Mike H" <mikehg1@removethis foraccess-4-free.com> wrote in message news:zLWOc.148454$%t6.5656@roc.nntpserver.com... > > "Alexander Nickolov" <agnickolov@mvps.org> wrote in message > news:uq$RdoldEHA.3612@TK2MSFTNGP09.phx.gbl... > > Your assertions fall out from thin air, you need to provide some > > hard details before we can even consider them... Working in C > > is one such detail - you can get things wrong easily in C, since you > > have to build all vtables by hand. (And I'm probably not saying > > anything new here...) > > I'm not sure how much more detail I can give without answering my own > question? > I would have thought this would be an easy question for someone with a > strong knowledge of this stuff. I have read Inside OLE, it does not provide > much detail on the subject. > > This seems to be common to Controls made with VB. The vTable offset starts > at 0 for IUknown, but the first exposed function starts at 1956. So we have: > > offset zero: > IUknown > IDispatch <--This would end at offset 27 > 28 through 1955 missing ...If I insert dummy placeholders here everything > works as expected > Foo Interface <--The offset starts at 1956 > > So I guess my next 2 questions would be why the gap? and is it possible to > specify an offset using C instead of placing 482 dummy placeholders? > > Thanks, > Mike H. > > > > > As a general advice, read the first 6 chapters of "Inside OLE" > > by Kraig Brockschmidt, MS Press (available on old MSDN > > Library CDs, otherwise long since out of print). Chapter 5 or 6 > > contains an example of building a COM object in C. > > > > -- > > ===================================== > > Alexander Nickolov > > Microsoft MVP [VC], MCSD > > email: agnickolov@mvps.org > > MVP VC FAQ: http://www.mvps.org/vcfaq > > ===================================== > > > > "Mike H" <mikehg1@removethis foraccess-4-free.com> wrote in message > > news:J0vOc.118584$%t6.34381@roc.nntpserver.com... > > > I'm still in the learning stage of the COM world and have a question > about > > > vtables. Using an Object browser I notice the vTable offset is 28 for > the > > > first function, which seems to make sense if you calculate the size of > the > > > Dispatch interface first. But some start with a vTable offset of usually > > > 1956 and these are usually the interface functions that I can't seem to > > > access. Most of the time it results in a GPF or a No Interface return > > value. > > > Can someone shed some light on how these vTables need to be implemented > > > and/or called? I am using plain C btw. > > > > > > Thanks, > > > Mike H. > > > > > > > > > > > >
- Previous message: Mike H: "Re: vTable offsets"
- In reply to: Mike H: "Re: vTable offsets"
- Next in thread: Mike H: "Re: vTable offsets"
- Reply: Mike H: "Re: vTable offsets"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|