DllImport and char*

Posted by Malfist on Stack Overflow See other posts from Stack Overflow or by Malfist
Published on 2010-04-02T18:35:21Z Indexed on 2010/04/02 18:43 UTC
Read the original article Hit count: 579

Filed under:
|
|
|
|

I have a method I want to import from a DLL and it has a signature of:

BOOL GetDriveLetter(OUT char* DriveLetter)

I've tried

    [DllImport("mydll.dll")]
    public static extern bool GetDriveLetter(byte[] DriveLetter);

and

    [DllImport("mydll.dll")]
    public static extern bool GetDriveLetter(StringBuilder DriveLetter);

but neither returned anything in the DriveLetter variable.

© Stack Overflow or respective owner

Related posts about c#

Related posts about dllimport