Skip to content

How to pass string by reference? #165

@gpetrou

Description

@gpetrou

I have the following simple method

void Test(char* output)
{
   output = strdup("This is a test");
}

How can I make the generator produce something like:

internal static extern void Test_0(global::System.IntPtr instance, out string output);

Currently it produces something like:

internal static extern void Test_0(global::System.IntPtr instance, sbyte* output);

and if you add the following line to Preprocess

ctx.SetMethodParameterUsage("Foo", "Test", 1, ParameterUsage.Out);

it will produce

internal static extern void Test_0(global::System.IntPtr instance, out sbyte output);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions