Managed C++ to C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What Method signature do you use in Managed C++ that will appear as the
following in C#--
F1(out int Int1){}

I have tried--
public void F1(int^ Int1){}

Thanks.
 
using namespace System::Runtime::InteropServices;

void F1([Out] int% Int1);

Marcus
 
Thanks that did it.

I found the keyword "%" but have not been able to find the [In] in the Msdn.
Could you suggest where to learn more about it. Is it an Attribute?

Thanks again.

--
John Olbert



Marcus Heege said:
using namespace System::Runtime::InteropServices;

void F1([Out] int% Int1);

Marcus
 
John Olbert said:
Thanks that did it.

I found the keyword "%" but have not been able to find the [In] in the
Msdn.
Could you suggest where to learn more about it. Is it an Attribute?

Yes. Lookup System.Runtime.InteropServices.InAttribute and
System.Runtime.InteropServices.OutAttribute. It also works with the full
name [OutAttribute] or [System::Runtime::InteropServices::OutAttribute], if
the name you supplied isn't found, the compiler automatically tries again
adding "Attribute" as a suffix.
Thanks again.

--
John Olbert



Marcus Heege said:
using namespace System::Runtime::InteropServices;

void F1([Out] int% Int1);

Marcus

John Olbert said:
What Method signature do you use in Managed C++ that will appear as the
following in C#--
F1(out int Int1){}

I have tried--
public void F1(int^ Int1){}

Thanks.
 
Back
Top