Re: marshalling an interface pointer
Drew Hohmann <drew@med-associates.com> wrote:
I've created an ATL project using VS2008, with the option merge
proxy/stub checked. All of the COM interfaces are set to
CComObjectRootEx<CComMultiThreadModel>
This doesn't by itself mean much. How is your server registered? What's =
the value of ThreadingModel registry entry for the CLSIDs in question?
[
object,
uuid(B7A09AF5-2868-11DF-8A39-001CC0A3A714),
oleautomation,
dual,
nonextensible,
helpstring("IMEDPositionDevice Interface"),
pointer_default(unique)
]
interface IMEDPositionDevice : IDispatch{
/*various functions*/
[id(15), helpstring("method Read")] HRESULT Read([in] REFIID riid,
[out] IUnknown** pData);
This method is not automation compatible. You shouldn't be using a =
method like this in an interface you claim to be [oleautomation].
COM is using a different thread to call the read function with
What do you mean, a different thread? Different from what?
so the
pointer returned from spdev->Read is invalid.
Invalid in what way? How do you determine this?
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not =
necessarily a good idea. It is hard to be sure where they are going to =
land, and it could be dangerous sitting under them as they fly overhead. =
-- RFC 1925