How can i correctly call .net function with multiple "ref" arguments?

3 ビュー (過去 30 日間)
Vladimir
Vladimir 2012 年 10 月 5 日
回答済み: The Pirate 2017 年 9 月 2 日
Hello!
I need to call .net method from dll. Method has few "ref" arguments.
C# code:
public static String FillData(ref Struct_Nodes struct_Nodes, ref Struct_Branches struct_Branches)
Matlab code:
a = some.namespace.Struct_Nodes();
b = some.namespace.Struct_Branches();
some.namespace.FillData(a,b);
But "a" and "b" were empty after matlab call.
If I call next C# function with 1 "ref" argument and wthout return value:
public static void FillNodes(ref Struct_Nodes struct_Nodes)
then I can get ref argument by return value:
a = some.namespace.Struct_Nodes();
b = some.namespace.FillData(a);
But "a" was empty, but "b" was filled with correct first argument values.
How can i correctly call .net function with multiple "ref" arguments?
Thank you!

回答 (1 件)

The Pirate
The Pirate 2017 年 9 月 2 日
Oh, my god. Five years passed, no one knows how to fix this problem. what a lively community.

カテゴリ

Help Center および File ExchangeGet Started with Microsoft .NET についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by