Click here to Skip to main content
15,922,015 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have C++ dll project (Win32 dll) which contains a function:
C++
int _stdcall abc(int* a)
{
       for (int i=0; i<5; i++)
            a[i]=i;
       return 0;
}

I compile it to a dll file (the abc() is exported) called "xy.dll".
I want to use "xy.dll" with abc() function in C#, how to use this function in C#? Thanks.
Posted

 
Share this answer
 
v2
C#
public int abc (int[] a)
{
      for (int i = 0; i < 5; i++)
           a[i] = i;
      return 0;
}
 
Share this answer
 
Comments
Andrewpeter 11-Sep-12 23:22pm    
No, the abc() function is in "xy.dll" which is built by C++ language, I want to call that function from C#.

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