Topic: C# DLL

Hi. I'm new here and i was wondering if you could make a dll in managed code so i can use it with C#.

I want something close to phidget's RFID API for .NET

Thanks for reading. Tagnard

Re: C# DLL

Dear Tagnard,

I don't see a problem. The sources are available, I would be happy to open a branch for any developer in the SVN repository that is willing to port this to c#. In the mean while, you can always use the current DLL in native-mode. But for manage code this quite sounds ugly wink

Cheers,

  Roel

Re: C# DLL

I will try and write it with the current DLL. But i need to have the reader that i have ordered.

Re: C# DLL

Great! It would be very nice to have a simple Managed C# wrapper for libnfc.dll
I suspect that there will be a lot developers interested in developing more GUI oriented products using C#
Let me know when you have something ready for committing into the repository, so others can help testing.

Re: C# DLL

i got my reader now and i have tried all day making thing work. but i failed.

I'm no good in C so if you want to make your DLL better, read this tutorial and implement it in the libnfc so i can access it from C#.

http://www.codeproject.com/KB/cs/usecdlllibincs.aspx

Re: C# DLL

Hey Tagnard,

Currently I'm working on version 1.1.0. It is almost done.
When I'm finished with that, I'll write a quick wrapper for ya to access it from C# wink

Cheers,

  Roel

7 (edited by Tagnard 2009-03-24 12:36:18)

Re: C# DLL

roel wrote:

Hey Tagnard,

Currently I'm working on version 1.1.0. It is almost done.
When I'm finished with that, I'll write a quick wrapper for ya to access it from C# wink

Cheers,

  Roel

I'm looking forward to it. I tried to pinvoke winscard.dll but it was harder than i thought.

Re: C# DLL

I emailed you a pre-example wink

9 (edited by Tagnard 2009-04-19 18:08:13)

Re: C# DLL

roel wrote:

I emailed you a pre-example wink

I checked your example and it looks like a good base to use. but i run into problems.
i can not connect to my reader(touchtag). I have closed touchtag service and i have tested it on
windows 7 build 7077 and on windows xp with same result.

all i get is "Could not connect to a NFC device"

Re: C# DLL

Hey,

Even on new firmware version it should work without a tag on top of it. But maybe you could try that?
Does the c (example) in the /win32/bin directory (command-line) "list" tool work?
Or does it gives the same result?

Thanks a lot in advance for testing.

Cheers,

  Roel

Re: C# DLL

When i use the list.exe from libnfc 1.1.0 i get
"Connected to NFC reader: ACR122U102"

So it works with the c code.

// Tagnard

Re: C# DLL

I don't understand, they work the same way. And if you use the list.exe with the DLL that was supplied by the .NET example, does it still work then?

Re: C# DLL

roel wrote:

I don't understand, they work the same way. And if you use the list.exe with the DLL that was supplied by the .NET example, does it still work then?

I tested both DLL's and they give me the same message.

14 (edited by Tagnard 2009-04-20 07:51:31)

Re: C# DLL

When i removed the try/catch statement i got an exception.

"An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"

pdi = nfc_connect(); is throwing this exception

Hope this helps you

Re: C# DLL

roel wrote:

I emailed you a pre-example wink

Can I have that example too?

I am badly in need of being able to use libnfc via C#. But to be honest my C++ skills are at an alltime low.

So forgive me for almost begging. This would so save my behind.

Re: C# DLL

erlando wrote:

I am badly in need of being able to use libnfc via C#.

I found the best way was to write a COM object that exposed an OLE automation interface with a type library allowing the interop framework to use it.

Re: C# DLL

Roel: Do you still have the example you sent me some time ago? I'm doing some progress with the RFID reader that i got from acs bot i have some problems with the reader that touchatag provides. If you still have the example i want to try again to get it working.

Re: C# DLL

Does anybody solved C# problems with libnfc? (except COM object communication)???
There has to be more user (developer) friendly way :-(

Re: C# DLL

I try to use as libnfc in Visual Studio 2008 to make an application in C # too.

I have a module equipped with an NFC PN533.

News about a possible use of libnfc C # under Windows 7?

I compiled everything but I do not have enough knowledge to integrate libnfc.

thank you

Re: C# DLL

Hi, I just wanted to know if there were any progress in this area.

seeing as this is excactly what i am looking for, and i really can't seem to find it anywhere.

The thing i want to do is simply create a funkction to return a list of ID's from the reader. in C#

In my eyes the most elegant solution would look something like:

string[] chipsOnReader = RFIDReader.getIDList();

It might not be possible to create such a thing. But it sure would be nice if it was possible for those of us who only have a limited knowledge of coding to use our RFID readers. And i believe that a simple way to implement them in c# would be a great way to do such a thing.

Re: C# DLL

It Seem i found what i was looking for

http://www.libnfc.org/community/post/3216/#p3216