Re: writing a Class Library....

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.
.



Relevant Pages

  • Re: C function return value?
    ... > either because it's well-known or it is passed from the caller. ... implementation-dependent mechanisms far more than the standard does. ... newsgroups for a particular implementation. ...
    (comp.lang.c)
  • Re: Access to function returning class-wide type
    ... I watched comp.lang.ada for little time, searched through posts which I got ... different mechanisms for passing the return object between them. ... If Ada were to provide a mechanism so that B.Proc'Access could be ... you need to write a wrapper anyway, you shouldn't have to rewrite the ...
    (comp.lang.ada)
  • Re: Functor adaptor question
    ... Am I correct in my conclusion that there is no such adapter in the standard ... It looks like there is one in Boost, and it only took about 8 ... Tim Roberts, timr@xxxxxxxxx ...
    (microsoft.public.vc.language)
  • Re: Forth Frustrations
    ... I think implementing LSE64 any other way in Standard Forth would be too complicated and slow. ... implementing Standard Forth as a wrapper around LSE64 would be easier. ... Sorry, that may work on your platform, but I know a real-world platform sitting about two feet from me as I type this where it isn't true. ...
    (comp.lang.forth)
  • Re: Forth Frustrations
    ... I think implementing LSE64 any other way in Standard Forth would be too complicated and slow. ... implementing Standard Forth as a wrapper around LSE64 would be easier. ... Sorry, that may work on your platform, but I know a real-world platform sitting about two feet from me as I type this where it isn't true. ...
    (comp.lang.forth)