-
September 11th, 2014, 03:24 PM
#1
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?
-
September 11th, 2014, 03:30 PM
#2
Re: Passing an array to a DLL
-
September 12th, 2014, 08:08 AM
#3
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?
-
September 12th, 2014, 12:00 PM
#4
Re: Passing an array to a DLL
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.
-
September 12th, 2014, 12:44 PM
#5
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>
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|