vtable - Compatibility of GObject and COM object models -


gobject implements objects in plain c using handful of conventions: static methods functions taking instance struct first argument. virtual methods implemented function pointers in class struct (a kind of vtable). can have inheritance placing parent class struct in child class struct, , on.

com different object system, used in windows, , designed coincide c++'s memory layout (at least msvc compiler). objects have vtable, can interface pointer, , can call methods of object. calling convention used similar (identical?) 1 described above, pass instance pointer first argument.

now, i'm wondering, is possible make gobject class/object valid in com? i'm thinking e.g. placing pointer class struct in beginning of instance struct, , writing glue code. able queryinterface pointer gobject subclass , call virtual methods on it?

if work, outline how?

if wouldn't work, differences in object system making impossible?


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -