Description
I am attempting to import methods from ‘sdk.dll’ so that I may use them in the Unity game engine. I have started implementing ‘AuthService’ which is meant to be a wrapper around ‘ZOOMSDK::IAuthService’. When I call my method ‘CreateAuthService(IntPtr)’ I get the return value SDKERR_INVALID_PARAMETER’. I am curious to know if the issue is coming from the parameter I supplied. Am I marshaling it incorrectly?
Which Windows Meeting SDK version?
v5.10.3.4884
Code Snippet (this is my C# code)
using System;
using System.Runtime.InteropServices;
using static ZoomNative;
public class AuthService
{
[DllImport("sdk.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern int CreateAuthService(IntPtr authService);
[DllImport("sdk.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern int DestroyAuthService(IntPtr authService);
private readonly IntPtr _authServicePtr;
public readonly SDKError createResult;
public SDKError destructResult { get; private set; }
public AuthService()
{
createResult = (SDKError)CreateAuthService(_authServicePtr);
}
~AuthService()
{
destructResult = (SDKError)DestroyAuthService(_authServicePtr);
}
}
Device:
- Device: Asus B550
- OS: Windows 10
Additional Context
This is the signature of the method I’m trying to import from c++.
extern "C"{
SDK_API SDKError CreateAuthService(IAuthService** ppAuthService);
}