When to use P/Invoke vs. Interop

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
 
L

Lloyd Dupont

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

Mattias Sjögren

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
 
R

Ross O'Neill

Thanks for the clarification. I guess P/Invoke is just another word
for Interop.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top