I seemed to have trouble trying to embed calls to an unmanaged dll(specifically the one from FTDI). I am currently running under the assumption that the free version of VS2005 (express) is possibly unable to link this. I am thinking a missing library of some kind.
Perhaps I am just attempting to resolve it incorrectly at compile time (not explaining to the compiler properly).
So for any .Net gurus, what might my problem be here?
Tony M.
You need to add the System.Runtime.InteropServices
And this is an example of how I invoked an unmanged dll
[DllImport("inpout32.dll", EntryPoint="Out32")]
public static extern void Output(int adress, int value);
Post me what you are looking to invoke and I can help.
teberle wrote:You need to add the System.Runtime.InteropServicesAnd this is an example of how I invoked an unmanged dll
[DllImport("inpout32.dll", EntryPoint="Out32")]
public static extern void Output(int adress, int value);Post me what you are looking to invoke and I can help.
Thanks, I got that far, but when I attempted to compile the system didn't know what [DLLImport meant. Also I was unable to add System.Runtime.InteropServices to the references of the IDE. It just wasn't listed.
Interestingly it did work if I uses a managed DLL, which wrapped the other functions. Which is wierd, and basically shows my lack of understanding as to the linking at this level.
I'll post the code I attempted and the code that worked, when I get a chance.
Tony M.
It's called P/Invoke ing (Platform invoke), and I don't think you have to add a reference to it. I think it's in the main System reference, so you would just have to say "using System.Runtime.InteropServices;" at the top of your code (assuming C#).
Referencing a Managed DLL which calls unmanaged DLLs works because the Managed DLL has already been compiled into bytecode.
flowblok wrote:It's called P/Invoke ing (Platform invoke), and I don't think you have to add a reference to it. I think it's in the main System reference, so you would just have to say "using System.Runtime.InteropServices;" at the top of your code (assuming C#).Referencing a Managed DLL which calls unmanaged DLLs works because the Managed DLL has already been compiled into bytecode.
I guess I misspoke, it isn't a managed DLL and it certainly isn't .NET since my VC++ 6.0 compilier doesn't know anything about .NET bytecode.
It is a type of DLL that the .NET compiler can figure out the offsets directly....
I now have the IDMX module, and now I am trying to figure out why the code I wrote, which is virtually the same, doesn't work.
In the end , a solution will be found... Let get out there and program ... guys! ahaaaahaaha...
Tony M.
