473,396 Members | 2,076 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,396 software developers and data experts.

C# call C Dll methods

84
Hi,
I am trying to use a dll written by 3rd party which has the following 4 methods.

Expand|Select|Wrap|Line Numbers
  1. __declspec(dllexport) UINT IniReadI (LPCSTR szS1,LPCSTR szE1,int nD1,LPCSTR szF1)
  2.  
  3. __declspec(dllexport) int IniReadS (LPCSTR szS1,LPCSTR szE1,LPCSTR szD1,LPSTR szRB,int nSOB,LPCSTR szF1)
  4.  
  5.  
Can someone please tell me how can i use these from .Net. I know i will need to use DllImport. Any help or example will be appreciated as it is very urgent:)


Thanks in advance.
Aug 20 '08 #1
2 1020
madankarmukta
308 256MB
HI,
Just add the declaration for the method in your class , add attribute of Dllimport[..] to that method . once you did it.. call that method where inside that class.You can google the usage of DllImport attribute .

Thanks
Aug 20 '08 #2
alag20
84
HI,
Just add the declaration for the method in your class , add attribute of Dllimport[..] to that method . once you did it.. call that method where inside that class.You can google the usage of DllImport attribute .

Thanks
Thanks.... I tried that and DllImport says entry point not found.

I added an extern "C"{ decl.... } and it seems to do the trick...


Thanks
Aug 20 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: dennis luehring | last post by:
i try to "publish" some of my very stupid methods (i need this for an interpreter) function_one procedure_one here is the code --------- class core {
8
by: ThomasR | last post by:
I understand that virtual methods on inherited objects are slower than non-virtual methods because of the indirection required to support the call. However, when looking at IL code produced by...
7
by: Byron | last post by:
I have several user controls that have a few methods in common, such LoadFromForm() which populates an object from controls on the form. I want to call that method from the form in which the...
13
by: jac | last post by:
Hae, I have a windows form with a ComboBox an other things. On that combobox I have an eventhandler on de selectedindexchanged. But somewhere in my code want to do excecute the same code that...
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
28
by: Peter Olcott | last post by:
I want to double check my understanding about how the .NET framework works. From what I understand every call to the .NET framework is ultimately translated into one of more API calls, is this...
46
by: Steven T. Hatton | last post by:
I just read §2.11.3 of D&E, and I have to say, I'm quite puzzled by what it says. http://java.sun.com/docs/books/tutorial/essential/concurrency/syncrgb.html <shrug> -- NOUN:1. Money or...
9
by: Steve Richter | last post by:
in a generic class, can I code the class so that I can call a static method of the generic class T? In the ConvertFrom method of the generic TypeConvert class I want to write, I have a call to...
3
by: DigitalBase | last post by:
Hi, I am trying to call a method on all objects in an array. What i am doing now :: $groups = $user->getGroups(); $newarray = array(); foreach ($groups as $group) { $newarray =...
2
by: Guoqi Zheng | last post by:
Dear Sir, I have an existing application done in ASP.NET(VB.NET), I need to change one page of it. Because I am not able to recompile the code and upload the new dll, I am thinking to use one...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.