accessing USB HID with C#

Xlobby plugin development

accessing USB HID with C#

Postby Mullaly on Thu Jul 07, 2005 11:33 am

Hi,

I'm trying to create a plugin for an AVermedia USB FM radio. I have attempted to create a C# dll using the steps on this website and I get it comming up in Xlobby. I however cannot access and write the data required to the HID device using windows API calls to the HID class.

I have looked on the "HID page" and other USB resources for sample code but I can't get data written to the device.

Does anyone have an example of how to do this in c#?

Alternitively does anyone know how I can use delph to give me the dll exports required to make a plugin for Xlobby? I have radio working fine in a stand alone delphi application.

I guess I can just have a button that launches the windows application however it would be nice to be able to control the radio from Xlobby.

Thanks...
Mullaly
 
Posts: 3
Joined: Sun Jul 03, 2005 2:36 pm

Postby badubo on Thu Jul 07, 2005 12:12 pm

I however cannot access and write the data required to the HID device using windows API calls to the HID class.


if the functions you need are located in a standard dll, you can use the interop DllImport procedure for importing the method:

[DllImport("mydll.dll")]
public static extern int myFnct();

See the msdn documentation for more information


Alternitively does anyone know how I can use delph to give me the dll exports required to make a plugin for Xlobby? I have radio working fine in a stand alone delphi application.

create a dll with winapi exports and use DllImport from your plugin
badubo
 
Posts: 505
Joined: Mon May 03, 2004 7:33 pm
Location: Belgium

Postby Mullaly on Fri Jul 08, 2005 2:13 am

Thanks badubo,

Looks like the problem was a dll function not working correctly, I have no idea why.

A seperate application might be the quickest way to get things going for now might revisit it later on. If I get a plugin going I'll post it up for everyone.

Thanks for your help.
Mullaly
 
Posts: 3
Joined: Sun Jul 03, 2005 2:36 pm