How to acces lib.pointer in C++ Mex Files

21 ビュー (過去 30 日間)
Richard Z.
Richard Z. 2025 年 1 月 21 日 13:47
コメント済み: 埃博拉酱 2025 年 1 月 23 日 8:58
Hello everyone,
I want to access lib.pointer within a mexFile using Matlab's C++ API. The pointer is transported as matlab::data::ArrayType::HANDLE_OBJECT_REF, but I don't know how to access the values within this structure. I want to convert this to a void pointer later. The lib.pointer contains a handle to a device and I am using this to communicate with the device via a separate API.
Hopefully someone can help me further.
Thank you in advance.

回答 (1 件)

埃博拉酱
埃博拉酱 2025 年 1 月 21 日 14:31
編集済み: 埃博拉酱 2025 年 1 月 21 日 15:31
lib.pointer has a Value property. Pass that to your MEX function.
  4 件のコメント
Richard Z.
Richard Z. 2025 年 1 月 23 日 8:31
Hmm ok but matlab is giving an error if I want to access the property:
The datatype and size of the value must be defined before the value can be retrieved.
The datatype of this libpointer is 'voidPtr'. Do you have a tip for me?
Thanks in advance!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCall C from MATLAB についてさらに検索

タグ

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by