I know the names of the methods that I need, in fact I have all the method names in the DLL file, it's just using them that I'm having a problem with. Originally I thought I was out of luck because I couldn't add the DLL as a reference to my solution, but I found out how to use DllImport and tried that, but I couldn't get anywhere, so I searched Google and came up with something. This is my code for one of the functions in FATXLib.dll:
Expand|Select|Wrap|Line Numbers
- [DllImport("FATXLib.dll")]
- public static extern List<string> CheckDivices(FATX.DeviceType.Types DeviceToSearchFor);
Anyway, I then have this method:
Expand|Select|Wrap|Line Numbers
- public static List<string> Main2()
- {
- return CheckDivices(FATX.DeviceType.Types.FATX_DEVICE_360HDD);
- }
Expand|Select|Wrap|Line Numbers
- private void button1_Click(object sender, EventArgs e)
- {
- List<string> devices = Main2();
- MessageBox.Show(devices.Count.ToString());
- }
Cannot marshal 'return value': Generic types cannot be marshaled.
I'm stumped. How can I get around this?