Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 8664

Rhino plugin in C# when wrapping C++ class

$
0
0

@Petras_Vestartas wrote:

Hi,

I am trying to wrap C++ class in order to call it in C#.

I have a question is it only possible to wrap classes but not function only?
I attached my Visual Studio project here too:
https://mega.nz/#!M54kwIZY!546zd9fIUg9DxCAWOniVOiyEQQJFS24ylGIBDrKIUkc

What I did I downloaded sample file from here:

Tested it and tried to run another C++ simple function to understand the workflow. Everything works fine. Tested in Rhino.
Now I am trying to pass not a function but the whole class. Is it possible to do so?

What I did:
1. I created C++ class (.h and .cpp ) in sample file. Works.
2. I initialized C++ class in sample file. Works.
3. Then I tried to initialize class functions from C++ class and it causes errors see screenshot attached. Error

What I am trying to do is to call the same functions as I did using C++ console application:

int main()
{
	MyGraph g1(5);
	g1.addEdge(0, 1);
	g1.addEdge(0, 2);
	g1.addEdge(1, 2);
	g1.addEdge(1, 3);
	g1.addEdge(2, 3);
	g1.addEdge(3, 4);
	g1.greedyColoring();
	return 0;
}

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 8664

Trending Articles