473,379 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

PLacing DLL funciton in a class

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);
Jan 25 '06 #1
1 1045
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

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jan 25 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mark Turney | last post by:
Problem: I have a vector full of two different derived class objects (class B and class C) that are derived from the same base class A. I want to loop through vector and invoke a member function...
2
by: Dickyb | last post by:
Extracting an Icon and Placing It On The Desktop (C# Language) I constructed a suite of programs in C++ several years ago that handle my financial portfolio, and now I have converted them to...
2
by: ad | last post by:
Hi, What is the funciton to get the BIOS's date and time?
3
by: jamitwidme | last post by:
Hello. I am a novice programmer and have a question I have a configuration file(configuration.cfg) I read this from reading.py using ConfigParser When I use ConfigParser.get() function, it...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.