;This- structure of COM-object
; in most coommon case
; with N number of slots for interface (each slot has ptr to interface)
; if one interface comletely included in other interface they share same interface slot
; with F number of additional fields
; in simplest case (for ex. ClassFactory): N=1, F=0 - whole structure is just 1 ptr
; in most complex case (for. ex. OOP interfaced object): structure is multilevel - it not contains slots for interface, but contain ptr to that slots (or ptr to ptr to)
; one rule: relization of all methods of every interface supported by pvself structure must know relativities of all members in this structure (members that used in that method)
;cInstances - dll field, increased with all AddRef & decreased with all Release of every COM-object created from interfaces realized in that DLL
;every COM-object exept ClassFactory has its own refCounter, that is affected with AddRef & Release too.
;#pseudocode QueryInterface(This,riid,ppv)
;{
; if [riid] in list of supported IID
; comcall ([This]+IndexofInterfaceSlot),IUnknown,AddRef
; setptr [ppv],[This]
; RESULT S_OK
; else
; setptr [ppv],0
; RESULT E_NO_INTERFACE
;}
;#pseudocode AddRef(This)
;{
; InterlockedIncrement(cAllInstances)
; if This is not ClassFactory (because ClassFactory has only 1 instance direct in DLL)
; InterlockedIncrement(InstanceCounter) of that This structure
;}
;#pseudocode Release(This)
;{
; InterlockedDecrement(cAllInstances)
; if This is not ClassFactory (because ClassFactory has only 1 instance direct in DLL)
; InterlockedDecrement(InstanceCounter) of that This structure
;}

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum