When to use P/Invoke vs. Interop

  • Thread starter Thread starter Ross O'Neill
  • Start date Start date
R

Ross O'Neill

Hi,
I was trying to learn more about when to use P/Invoke vs. Interop. The
book I am reading says use P/Invoke when I am calling unmanaged Windows
API function. Is P/Invoke only used with unmanaged API functions, or
could I use Interop instead? To my understanding I could use Interop
all the time but the advantage of P/Invoke is for performance reasons
since it does not do type checks, etc. Am I correct?

Thanks
Ross
 
uh?
I though tha P/Invoke / Interop was just different name for the same things.
So, what's the difference?
 
I though tha P/Invoke / Interop was just different name for the same things.
So, what's the difference?

I'd say that P/Invoke is just one way to accomplish interop between
managed and native code (the other options being COM interop and C++
interop/IJW). So I'm not sure what the original poster means either.


Mattias
 
Back
Top