> > So can ALL HANDLEs be shared? E.g., one created by CreateFile()?
>
> I didn't mean you can share *all* HANDLES; just sync object
> HANDLEs (like a
> mutex handle, an event handle, or a semaphore handle.)
>
> Of course you could share a file HANDLE, but you *can't* write to it from
> multiple threads at once, or you will probably corrupt the file.

Yes, that makes sense - but trying to use it would not crash in itself, it's
just not a very sensible thing to do, correct?

> My whole point was, you don't need to protect access to a sync object; a
> sync object is protecting access to some other object!  :-)

Yup, I get that now {:v)

> But as far as ActiveX objects are concerned, I have never come across one
> that is not inproc, and I *think* that they can't actually be out-of-proc,
> but you need to check the MSDN for that.  Please note that for a COM DLL
> server to access anything that's not directly passed to it in the calling
> process's address space is at best considered bad practice, and at worst
> will crash the whole thing (for out-of-proc servers.)  Anything it needs
> must be passed to it.  That is what COM's interface abstractions are all
> about.

I understand, but I meant: what if I pass a HANDLE across (so using the
passing mechanism correctly) - can I use this HANDLE safely in the OCX code,
or am I in a different process now? I'm not sure if a HANDLE is one of the
automation types, but this is theoretical here.

Your answer above appears to suggest it should be safe...

--
Jason Teagle
[EMAIL PROTECTED]



_______________________________________________
msvc mailing list
[email protected]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for 
subscription changes, and list archive.

Reply via email to