thenoob94 Posted April 19, 2023 Report Share Posted April 19, 2023 I have the following c function: extern "C"{ int getInterfaces( uint32_t numInterface, void* g_hSystem); } int getInterfaces( uint32_t numInterface, void* g_hSystem) { //Get Interface bool bChanged = false; SV_RETURN ret = SVSystemUpdateInterfaceList(g_hSystem, &bChanged, 1000); if (SV_ERROR_SUCCESS != ret) { printf("%s SVSystemUpdateInterfaceList failed!:%d\n", __FUNCTION__, ret); return -1; } ret = SVSystemGetNumInterfaces(g_hSystem, &numInterface); if (SV_ERROR_SUCCESS != ret) { printf("%s SVSystemGetNumInterfaces failed!:%d\n", __FUNCTION__, ret); return -1; } if (0 == numInterface) { printf("%s No Interface Available!\n", __FUNCTION__); return -1; } } How would I create "void* g_hSystem" in Labview? Quote Link to comment
Zou Posted April 19, 2023 Report Share Posted April 19, 2023 You need the .h file which defines g_hSystem. Quote Link to comment
Rolf Kalbermatter Posted June 17, 2023 Report Share Posted June 17, 2023 It misses context. void means NOTHING, and void * means a pointer to whatever the C programmer may have decided. Problem is that if the caller and callee don't agree what that anything means, really BAD things will happen. But without some more information all I can say is that it is a pointer and that would be in the LabVIEW Call Library Node a pointer sized integer. If that could work in this context is at least questionably. There obviously would need to be some other function that can return such a "handle"to you. The functions as you show them only consume this handle and can't create it in a meaningful way. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.