Nicholas Paldino [.NET/C# MVP] <mv*@spam.guard.caspershouse.comloquated
like no one had ever loquated before with:
WTH,
Is there any particular reason you are using an MTA with your
program? If this is a Windows Forms app, you really need to set it to
STA, so that the controls are guaranteed to work as advertised (some
of them will not).
To answer your question, there is nothing in the framework to help
with this kind of marshaling. You will have to call the API's
through interop yourself.
What exactly are you trying to do?
Thanks for the caveat about MTA and controls. This is a very simple form
which shows video, I have a per-form thread that instantiates a copy of my
C++ MPEG4 compression COM object (wraps up DirectShow and some other stuff
for me) but for various reasons I want the compressor initialized prior to
the form's worker thread running so I need to pass the interface to the
worker thread.
I'll reconsider the reasons behind not having the worker thread
create/initialize/hold the COM object entirely, but it kept some things
simpler that way (although quite obviously introducing complexity here,
LOL.)
Thanks for the heads up, as a long-time C++ guy absorbing .NET I certainly
appreciate those types of warnings.
WTH:)
--
"Shaun Wright-Phillips has got a big heart. It's as big as him, which
isn't very big, but it's bigger." - Kevin Keegan