Passing an array to a DLL
I'm having trouble figuring out how to pass an array (buffer) to a DLL. Currently I have the code taking in a list of a string of parameters for a command line call:
m_processMethodInfo.Invoke(m_checkObject, list.ToArray<object[]>());
Is there any way to pass in an array (buffer) to the Invoke() function? Or possibly add an array to the list already created?
Re: Passing an array to a DLL
Re: Passing an array to a DLL
No it's not a COM object, it's a .net assembly.
Is there a better way than using the invoke method?
Re: Passing an array to a DLL
Quote:
Originally Posted by
mson9
No it's not a COM object, it's a .net assembly.
Is there a better way than using the invoke method?
Yes. Add a referenced to the assembly in the project where you wish to use the dll.
And in the source code, create a class instance and call a method (the same as you would for a class that is directly in your project). You'll need to also add a using xxxnamespace; where you are using the code from the assembly.
Re: Passing an array to a DLL
Thanks, but I figured a way to do what I was trying to do.
It's similar to the example code here:
http://www.dotnetperls.com/getmethod <http://www.dotnetperls.com/getmethod>