Re: marshalling
"ajk" <anders43@gmail.com> wrote in message
news:94dee2e4-496a-4553-9e8d-3eba09645f6b@q39g2000hsf.googlegroups.com
The following line fails (exception) if CoInitializeEx(NULL,
COINIT_MULTITHREADED ) is used but works if APARTMENT_THREADED
Do you create any threads? If so, do you initialize COM the same way on
all of them - COINIT_MULTITHREADED everywhere? Or do you enter STA on
some, MTA on others?
Are you sure that the server is an out-of-proc server? The symptoms you
are describing suggest very strongly that you are actually using an
in-proc STA server. This way, when the client was also STA, there was no
marshalling involved. But now that the client is MTA, marshalling kicks
in, and there's some problem with it.
hr =
m_pObjManager.Create(pSysCtxId,pDataMode,displayDlg,localThread);
m_pObjManager declared as
CComPtr<IAfwObjectManager> m_pObjManager;
This cannot possibly be true. CComPtr doesn't have Create method. How is
m_pObjManager really declared?
Are you, by any chance, implementing IAfwObjectManager yourself, on the
client side?
--
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