Click here to Skip to main content
15,882,329 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi ,
Please can anyone help me ?
i m trying to call a function say getdevice();
which is present in my unmanaged dll. the function in dll has parameters say
getdevice(char **pDeviceList,int *pDeviceCount, unsigned longulFlags)
actually i m using c# and doing coding in c# as well and my dll is in c++ and whole coding of my application is also in c++ but i want to import my dll and call my functions , I have code to import my dll but dont know how to call the function and what parametrs i have to pass from main()
I dont know while coding in c# the proper datatypes and proper way for the parameters to pass while calling my function present in dll .

Is it possible in c# to pass pointers as parametrs while calling a function present in dll from main()
because as it can be seen above function(getdevice()) has poniters as parameters.
In c# Is there any way to pass pointers through a function to call a function from main()
Aasif Eqbal
aasifaslamy85@gmail.com
Posted
Updated 21-Jan-10 3:09am
v2

1 solution

You can call your unmanaged methods using PInvoke. Check the folllowing articles for details.

http://msdn.microsoft.com/en-us/library/aa446536.aspx[^]
http://msdn.microsoft.com/en-us/magazine/cc164123.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900