Exception thrown: Access violation reading location when running InitSDK

Description
So I am trying to get a simple program up and running. All it needs to do is to join a hardcoded meeting, that’s it, but I’m running into some issues. I get the following Exception when trying to run this in debug in VS:

Exception thrown at 0x00007FFAA06966A4 (Cmmlib.dll) in Zoom Bot.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.

What does this mean? The error is on this line:

ZOOM_SDK_NAMESPACE::SDKError err = ZOOM_SDK_NAMESPACE::InitSDK(initParam);

I am quite sure there is something wrong with either my code or my setup, as I have no idea what I am doing, because of the lack of documentation.

Which Windows Meeting SDK version?
I am using the latest: v5.17.5.31085

Code
Here is the code where I am getting exception:

#include "ZoomSDKHelper.h"
#include "zoom_sdk.h"
#include "auth_service_interface.h"
#include "meeting_service_interface.h"
#include "AuthServiceEventListener.h"
#include <string>

ZoomSDKHelper::ZoomSDKHelper() {
    // Constructor implementation (if needed)
}

ZoomSDKHelper::~ZoomSDKHelper() {
    // Destructor implementation (if needed)
}



void ZoomSDKHelper::InitializeSDK() 
{
    ZOOM_SDK_NAMESPACE::InitParam initParam;
    initParam.strWebDomain = "https://zoom.us";
    initParam.strSupportUrl = "https://zoom.us";

    initParam.emLanguageID = ZOOM_SDK_NAMESPACE::LANGUAGE_English;

    initParam.enableLogByDefault = true;
    initParam.enableGenerateDump = true;

    ZOOM_SDK_NAMESPACE::SDKError err = ZOOM_SDK_NAMESPACE::InitSDK(initParam); // Exception thrown here
    if (ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS != err) {
        
    }
}

void ZoomSDKHelper::AuthenticateSDK(const zchar_t* JWT_TOKEN)
{
    // Create an AuthService object     
    ZOOM_SDK_NAMESPACE::IAuthService* authService = nullptr;
    ZOOM_SDK_NAMESPACE::SDKError err = ZOOM_SDK_NAMESPACE::CreateAuthService(&authService);

    if (err != ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS) {
        // Handle SDK service creation error
        return;
    }


    // Create and set the authentication event listener
    AuthServiceEventListener* authListener = new AuthServiceEventListener(); // Consider using smart pointers for better memory management
    if (authService) {
        authService->SetEvent(authListener);

        // Set up authentication parameters
        ZOOM_SDK_NAMESPACE::AuthContext authParam;
        authParam.jwt_token = JWT_TOKEN;

        // Start the authentication process
        err = authService->SDKAuth(authParam);
        if (err != ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS) {
            // Handle authentication error
            // Cleanup if necessary
            delete authListener;
        }
    }

}

void ZoomSDKHelper::JoinMeeting(const UINT64& meetingNumber, const zchar_t* displayName, const zchar_t* password)
{
    ZOOM_SDK_NAMESPACE::IMeetingService* meetingService = nullptr;
    ZOOM_SDK_NAMESPACE::CreateMeetingService(&meetingService);
    if (meetingService == nullptr) {
        // Handle error
    }

    if (meetingService) {
        ZOOM_SDK_NAMESPACE::JoinParam joinParam;
        joinParam.userType = ZOOM_SDK_NAMESPACE::SDK_UT_NORMALUSER;
        ZOOM_SDK_NAMESPACE::JoinParam4WithoutLogin& wlParam = joinParam.param.withoutloginuserJoin;
        wlParam.meetingNumber = meetingNumber; // Replace with the meeting number
        wlParam.userName = displayName; // Replace with your display name
        wlParam.psw = password; // Replace with the meeting password, if any
        wlParam.vanityID = NULL;
        ZOOM_SDK_NAMESPACE::SDKError err = meetingService->Join(joinParam);
        if (ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS != err) {
            // Handle join meeting error
        }
    }

}

And here the main.cpp file:

#include "ZoomSDKHelper.h"

int main() {
    ZoomSDKHelper zoomHelper;
    zoomHelper.InitializeSDK();
    zoomHelper.AuthenticateSDK("JWT");
    zoomHelper.JoinMeeting(meetingid, "name", "pass");

    // Add your application logic here

    return 0;
}

I should note that the JWT, meetingid, name and pass, are all the real ones, I am just not going to share those here. But that shouldn’t matter as the issue is in the InitializeSDK().

I know that I am in way over my head, and that I have no idea what I am doing, but that is how it is going to be.

Any help is much appreciated : D

@noahviktorschenk Hope you will be fine.

This is null pointer error. You’re calling a null pointer member.

For more (WhatsApp).

Thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.