PLacing DLL funciton in a class

D

Dmension

I have a dll that I need to use in an application that I am writing. Can
anyone point me in the direction of creating a class in my project that has
all the dllimport statements. I have used the dll but all the dll import
statements are within the same code..

Sample Code:
/// </summary>

public class Form1 : System.Windows.Forms.Form

{



[DllImport("ca3000API.dll",EntryPoint="_Initca3000")]

public static extern int

int_Initca3000();

[DllImport("ca3000API.dll", EntryPoint="_GetConnectStr")]

public static extern int int_GetConnectStr(StringBuilder CS,

ref uint CSLen);

[DllImport("ca3000API.dll",EntryPoint= "_DeInitca3000")]

public static extern int int_DeInitca3000();

[DllImport("ca3000API.dll",EntryPoint= "_BadgeOperation")]

public static extern int int_BadgeOperation(int Facility,

Int64 Badge, ref string FirstName, ref string LastName,

ref string MI, UInt16 AGNo1, UInt16 AGNo2, UInt16 AGNo3,

UInt16 AGNo4, UInt16 AGNo5, UInt16 AGNo6, UInt16 Operation);

[DllImport("ca3000API.dll", EntryPoint = "_DoorOperation")]

public static extern int int_DoorOperation(int Panel, int Door,

int Time, int Operation);
 
M

Mattias Sjögren

Can anyone point me in the direction of creating a class in my project that has
all the dllimport statements.

Just add a new class to your project and cut and paste all the
declarations into it.


Mattias
 

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