Aladdin Etoken Pro USB device

  • Thread starter zoltan_papp_123456
  • Start date
Z

zoltan_papp_123456

OS : Windows XP Professional
Environment : MS Visual Studio 2005
Language : C#

Hi, I am trying to write a windows application using C# that accesses
the Aladdin Etoken Pro USB device. (www.aladdin.com)


I am using [DllImport("eToken.dll")] to import functions but i am not
sure about the following things :


1, Can i just only import 1 function at a time ?


2, What happens when the unmanaged function in the dll that i am
importing has data types that do not exist in the class under C# ? Do
i use the MarshallbyAttribute function or how does it work ?


3, Does someone have a c# sample about importing unmanaged functions
via dll ?


Any help welcome ! I spend my whole day on this so i want to get going.

Seems like that there aren't a lot of people out there whom want to
program the etoken in C#.


Zoltan.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

OS : Windows XP Professional
Environment : MS Visual Studio 2005
Language : C#

Hi, I am trying to write a windows application using C# that accesses
the Aladdin Etoken Pro USB device. (www.aladdin.com)


I am using [DllImport("eToken.dll")] to import functions but i am not
sure about the following things :


1, Can i just only import 1 function at a time ?
Yes, in fact that is the only way, you declare a method ( a function in the
dll) and especify where that function is declared.
2, What happens when the unmanaged function in the dll that i am
importing has data types that do not exist in the class under C# ? Do
i use the MarshallbyAttribute function or how does it work ?

What kind of types?
3, Does someone have a c# sample about importing unmanaged functions
via dll ?

See any example of [DllImport] , also go to pinvoke.net it has lot of info
about p/invoke
 
Z

zoltan_papp_123456

Ignacio said:
Hi,

OS : Windows XP Professional
Environment : MS Visual Studio 2005
Language : C#

Hi, I am trying to write a windows application using C# that accesses
the Aladdin Etoken Pro USB device. (www.aladdin.com)


I am using [DllImport("eToken.dll")] to import functions but i am not
sure about the following things :


1, Can i just only import 1 function at a time ?
Yes, in fact that is the only way, you declare a method ( a function in the
dll) and especify where that function is declared.

Thank you !
What kind of types?


DWORD etCreateTalker (
LPCTSTR lpszReaderName,
LPHTALKER phTalker,
DWORD dwFlags
);

I can't import neither LPCTSTR nor LPHTALKER. Both of them are specific
to the eToken.
3, Does someone have a c# sample about importing unmanaged functions
via dll ?

See any example of [DllImport] , also go to pinvoke.net it has lot of info
about p/invoke

Thank you !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top