I'd say that it's pretty hard to comment definitively without info about what unmanaged code is being called, and what C++ data is being passed. Do you have any samples? You seem pretty confident that PInvoke is always slower, when I don't see how that can be true in every case (or how you could have tested every case).
The marshaling from managed to unmanaged types can only be skipped if the data being passed is already in a format usable by the unmanaged code. For example, C-style (null-terminated) strings (not managed strings declared with __gc) are in the form that most API calls expect, so no marshaling is needed there. But in most other cases, some kind of marshaling is needed. At 06:26 PM 11/28/2005, Muhammad Adel wrote >Hello >I would like to know what is the cause in performance difference between the >PInvoke and the IJW methods. Is the marshaling of data from managed to >unmanaged types skipped when using the IJW method? >Thanks in advance. > >Muhammad Adel > <http://mohammadadel.blogspot.com/> My blogs J. Merrill / Analytical Software Corp =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
