the only 2 guides i've found for making a custom surrogate were not very clear (http://masterblood.ru/ch12c.shtml) (http://msdn.microsoft.com/en-us/library/ms682432(v=vs.85).aspx)
does anyone know of any full working examples of one? I think it would be helpful for me to see.
If not, I'm confused about how exactly I implement the interfaces they say I need to implement (IMarshal, IUnknown, and IClassFactory) I know I need to write functions like loaddllserver and freesurrogate myself, but do i actually have to write functions like addref and release myself too? Usually when i create a com object, I use ATL and use all of those Macros to define those functions, but that doesnt work unless you create the com object with cocreateinstance, and they seem to be using new. also, the msdn page for IMarshal says "Implement IMarshal only when you believe that you can realize significant optimizations to the COM default implementation. " I don't have any optimizations to make to the marshalling so I'd like to use theirs if possible. I know the non-msdn page doesnt mention IMarshal, but MSDN says I need to use it.
Are the surrogate objects normal com objects, or are they just regular objects that inherit from those Interfaces? do I need an idl file?
I understood what the example on the site did, but I'm confused about how the classes get defined in the first place.
Any help you could give would be great.
Thanks.