Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how bind std::vector<CustomStructure> ? #3

Open
rafadsm opened this issue Nov 21, 2021 · 0 comments
Open

how bind std::vector<CustomStructure> ? #3

rafadsm opened this issue Nov 21, 2021 · 0 comments

Comments

@rafadsm
Copy link

rafadsm commented Nov 21, 2021

Hi, I'm trying to send an array of a custom structure to mono, how would I be able to do this?

c++

std::vector<CustomStructure> vec;
method.invoke_instance<void(std::vector<CustomStructure>)>(object, vec);

I've already made the converter for this structure, but I don't know how to make the signature to use an array because the method is not found in c#

c#

public void OnData(ns2.CustomStructure[] data)
{
    Console.WriteLine($"OnData: ${data.Length}");
}

the signature: Test::OnData(ns2.CustomStructure[])

if i use inside my namespace, i get * Assertion at ..\mono\metadata\object.c:1938, condition 'klass' not met

I would also like to understand more about std::vector / std::array > any_type[], any_type is my type ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant