Re: writing a Class Library....
- From: Jim Krikris <Jimmy@xxxxxxxxxx>
- Date: Sun, 05 Apr 2009 14:22:45 +0300
Tim Roberts wrote:
There are a couple of ways. You can create COM objects from C#, and call
them using the standard COM mechanisms from anywhere. Or, you can include
a managed C++ wrapper around your C# class and use it to create DLL
exports.
Do you have an example of the second way?
Lets say how should i edit the following code...
using System;
using System.IO;
namespace MyExports
{
public class DrivesFound
{
public static string[] getDrivesFound() // exported
{
DriveInfo[] Drives = DriveInfo.GetDrives();
String[] ret = new String[Drives.Length];
for(int i=0;i<Drives.Length;i++)
ret[i] = Drives[i].Name;
return ret;
}
}
}
I dont know if it is even possible to export a struct that would hold
the results.
.
- Follow-Ups:
- Re: writing a Class Library....
- From: Giovanni Dicanio
- Re: writing a Class Library....
- References:
- writing a Class Library....
- From: Jim Krikris
- Re: writing a Class Library....
- From: Tim Roberts
- writing a Class Library....
- Prev by Date: Re: Passing arrays as parameters
- Next by Date: Re: Passing arrays as parameters
- Previous by thread: Re: writing a Class Library....
- Next by thread: Re: writing a Class Library....
- Index(es):
Relevant Pages
|