Trouble calling cpp dll function whose input is char**.

Oct 8 2009 8:29 AM

Hello,
I am Developing a C# WINDOWS application. In my Application i need to
call a cpp dll which returns the list of Drives connected to the PC.
The Function is "int GetDeviceDiskName(char**);". I can get all the
drive names in my vc++ application after i call this function.
char *device[10];
 
  for(int i = 0; i < 10; i++)
  {
   device[i] = new char[10];
   memset(device[i],0,10);
  }
  int nRes = GetDeviceDiskName(device);
device returns all the USB's attached to the PC.
But I have Trobule calling this function in C#.Net.
Can some one help me how to call this function.
In the Dll file the "device" array will be updated in this way,
if(bDiskFound)
{
   device[cnt][0]=cDiskID;
   cnt++; 
}

Answers (1)