Sample code for initializing returns error code ZoomVideoSDKErrors_Wrong_Usage

Description
I have copied the sample code from “Initialize the SDK”, and it compiles without errors. When I run the code, the call to initialize the Video SDK always returns 1, which is supposedly the value of the error code “ZoomVideoSDKErrors_Wrong_Usage”:

int returnVal = m_pVideoSDK->initialize(initParams); // Always returns 1

Which Windows Video SDK version?
zoom-video-sdk-windows-1.3.2

Additional context
I am using the sample code copied straight from the Zoom Developer website (Initialize the SDK), so I am surprised that it does not work as is. I suspect the code samples there are obsolete, and that some necessary steps are missing.

I am using the 32-bit (x86) Video SDK libraries (version 1.3.2), compiling and linking successfully under Qt 5.15.2 MinGW 32-bit.

Hi @drpclind ,

Can you please provide the full stack trace in text so that we can better assist?

Thanks,
Gianni

Hello,

I have generated a stack trace at the point where the following code is called:

int returnVal = m_pVideoSDK->initialize(initParams);

My IDE does not trace into the initialize() function, probably because the library does not have debug information.

A couple years ago, when I was using an older version of the SDK (when JWT was being used for authorization), I had a similar problem that was traced to a mismatch in the order of function entry points in the DLL. I think my linker was mixing up the entry points and calling the wrong function. I am wondering if a similar problem is happening this time? In the past, I think I fixed it by hacking the associated .h file to change the order of the function declarations.

Here is the stack trace. I will be happy to send you any further information that you may need.

Thanks

Thread 12 (Thread 24648.0x3b8c):
#0 0x774c470c in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#1 0x77485ba0 in ntdll!TpCallbackIndependent () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#2 0x7589fa29 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
No symbol table info available.
#3 0x774b7a9e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#4 0x774b7a6e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#5 0x00000000 in ?? ()
No symbol table info available.

Thread 11 (Thread 24648.0x3160):
#0 0x774c470c in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#1 0x77485ba0 in ntdll!TpCallbackIndependent () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#2 0x7589fa29 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
No symbol table info available.
#3 0x774b7a9e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#4 0x774b7a6e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#5 0x00000000 in ?? ()
No symbol table info available.

Thread 10 (Thread 24648.0x6d44):
#0 0x774c2f8c in ntdll!ZwWaitForMultipleObjects () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#1 0x76a1c753 in WaitForMultipleObjectsEx () from C:\WINDOWS\System32\KernelBase.dll
No symbol table info available.
#2 0x75a20428 in combase!CoGetMarshalSizeMax () from C:\WINDOWS\System32\combase.dll
No symbol table info available.
#3 0x75a97bd9 in combase!ReleaseFuncDescs () from C:\WINDOWS\System32\combase.dll
No symbol table info available.
#4 0x75a202ed in combase!CoGetMarshalSizeMax () from C:\WINDOWS\System32\combase.dll
No symbol table info available.
#5 0x75a9ac0f in combase!CoResumeClassObjects () from C:\WINDOWS\System32\combase.dll
No symbol table info available.
#6 0x75a9abf0 in combase!CoResumeClassObjects () from C:\WINDOWS\System32\combase.dll
No symbol table info available.
#7 0x75a9abf0 in combase!CoResumeClassObjects () from C:\WINDOWS\System32\combase.dll
No symbol table info available.
#8 0x05caff80 in ?? ()
No symbol table info available.
#9 0x7589fa29 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
No symbol table info available.
#10 0x774b7a9e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#11 0x774b7a6e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#12 0x00000000 in ?? ()
No symbol table info available.

Thread 8 (Thread 24648.0x24f8):
#0 0x774c2f8c in ntdll!ZwWaitForMultipleObjects () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#1 0x76a1c753 in WaitForMultipleObjectsEx () from C:\WINDOWS\System32\KernelBase.dll
No symbol table info available.
#2 0x76e45436 in CertDuplicateCTLContext () from C:\WINDOWS\SysWOW64\crypt32.dll
No symbol table info available.
#3 0x7589fa29 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
No symbol table info available.
#4 0x774b7a9e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#5 0x774b7a6e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#6 0x00000000 in ?? ()
No symbol table info available.

Thread 7 (Thread 24648.0x2c94):
#0 0x774c2f8c in ntdll!ZwWaitForMultipleObjects () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#1 0x6d923666 in WINMM!PlaySoundW () from C:\WINDOWS\SYSTEM32\winmm.dll
No symbol table info available.
#2 0x7589fa29 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
No symbol table info available.
#3 0x774b7a9e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#4 0x774b7a6e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#5 0x00000000 in ?? ()
No symbol table info available.

Thread 6 (Thread 24648.0x6680):
#0 0x774c470c in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#1 0x77485ba0 in ntdll!TpCallbackIndependent () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#2 0x7589fa29 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
No symbol table info available.
#3 0x774b7a9e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#4 0x774b7a6e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#5 0x00000000 in ?? ()
No symbol table info available.

Thread 5 (Thread 24648.0x36f4):
#0 0x774c470c in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#1 0x77485ba0 in ntdll!TpCallbackIndependent () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#2 0x7589fa29 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
No symbol table info available.
#3 0x774b7a9e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#4 0x774b7a6e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#5 0x00000000 in ?? ()
No symbol table info available.

Thread 4 (Thread 24648.0x60ac):
#0 0x774c470c in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#1 0x77485ba0 in ntdll!TpCallbackIndependent () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#2 0x7589fa29 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
No symbol table info available.
#3 0x774b7a9e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#4 0x774b7a6e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#5 0x00000000 in ?? ()
No symbol table info available.

Thread 3 (Thread 24648.0x4220):
#0 0x774c470c in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#1 0x77485ba0 in ntdll!TpCallbackIndependent () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#2 0x7589fa29 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
No symbol table info available.
#3 0x774b7a9e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#4 0x774b7a6e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#5 0x00000000 in ?? ()
No symbol table info available.

Thread 2 (Thread 24648.0x249c):
#0 0x774c470c in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#1 0x77485ba0 in ntdll!TpCallbackIndependent () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#2 0x7589fa29 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
No symbol table info available.
#3 0x774b7a9e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#4 0x774b7a6e in ntdll!RtlGetAppContainerNamedObjectPath () from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#5 0x00000000 in ?? ()
No symbol table info available.

Thread 1 (Thread 24648.0x424c):
#0 TMainWindow::initZoom (this=0x84fe14) at …\cszoom\TMainWindow.cpp:48
initParams = {domain = 0x407d90 <_ZN9__gnu_cxxL21__default_lock_policyE+116> L"https://zoom.us", logFilePrefix = 0x407db0 <_ZN9__gnu_cxxL21__default_lock_policyE+148> L"prefix", enableLog = true, enableIndirectRawdata = false, audioRawDataMemoryMode = ZOOMVIDEOSDK::ZoomVideoSDKRawDataMemoryModeStack, videoRawDataMemoryMode = ZOOMVIDEOSDK::ZoomVideoSDKRawDataMemoryModeStack, shareRawDataMemoryMode = ZOOMVIDEOSDK::ZoomVideoSDKRawDataMemoryModeStack}
#1 0x004021f3 in TMainWindow::startZoom (this=0x84fe14) at …\cszoom\TMainWindow.cpp:54
PRETTY_FUNCTION = “void TMainWindow::startZoom()”
#2 0x004024f2 in TMainWindow::qt_static_metacall (_o=0x84fe14, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x84da24) at debug\moc_TMainWindow.cpp:72
_t = 0x84fe14
#3 0x68d6502e in void doActivate(QObject*, int, void**) () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\Qt5Core.dll
No symbol table info available.
#4 0x68c733f4 in QSingleShotTimer::timerEvent(QTimerEvent*) () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\Qt5Core.dll
No symbol table info available.
#5 0x68c69f13 in QObject::event(QEvent*) () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\Qt5Core.dll
No symbol table info available.
#6 0x61fc7b2c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\Qt5Widgets.dll
No symbol table info available.
#7 0x61fce21a in QApplication::notify(QObject*, QEvent*) () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\Qt5Widgets.dll
No symbol table info available.
#8 0x68c41579 in QCoreApplication::sendEvent(QObject*, QEvent*) () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\Qt5Core.dll
No symbol table info available.
#9 0x68c92ba7 in QEventDispatcherWin32Private::sendTimerEvent(int) () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\Qt5Core.dll
No symbol table info available.
#10 0x68c9351b in QEventDispatcherWin32::event(QEvent*) () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\Qt5Core.dll
No symbol table info available.
#11 0x61fc7b2c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\Qt5Widgets.dll
No symbol table info available.
#12 0x61fce21a in QApplication::notify(QObject*, QEvent*) () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\Qt5Widgets.dll
No symbol table info available.
#13 0x68c40f6c in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\Qt5Core.dll
No symbol table info available.
#14 0x68c479f4 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\Qt5Core.dll
No symbol table info available.
#15 0x68c8f257 in QEventDispatcherWin32::sendPostedEvents() () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\Qt5Core.dll
No symbol table info available.
#16 0x6ab07c2c in QWindowsGuiEventDispatcher::sendPostedEvents() () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\platforms\qwindows.dll
No symbol table info available.
#17 0x68c92a06 in QEventDispatcherWin32::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\Qt5Core.dll
No symbol table info available.
#18 0x6ab07c07 in QWindowsGuiEventDispatcher::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\platforms\qwindows.dll
No symbol table info available.
#19 0x68c3fe61 in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\Qt5Core.dll
No symbol table info available.
#20 0x68c487c3 in QCoreApplication::exec() () from C:\Users\Peter\Projects\cyberslate\distro\cszoom\win\qt5\debug\Qt5Core.dll
No symbol table info available.
#21 0x00401f82 in qMain (argc=1, argv=argv@entry=0x182a110) at …\cszoom\main.cpp:10
a =
w = { = {}, static staticMetaObject = {d = {superdata = {direct = 0x623a778c QMainWindow::staticMetaObject}, stringdata = 0x408940 <qt_meta_stringdata_TMainWindow>, data = 0x4089a0 <qt_meta_data_TMainWindow>, static_metacall = 0x4024d0 <TMainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, ui = 0x2fd7a20, m_pVideoSDK = 0x909900, lastZoomError = 0}
#22 0x004038f2 in WinMain@16 () at qtmain_win.cpp:97
argc = 1
argvW = 0x8d8da0
argv = 0x182a110
exitCode =
#23 0x0040435d in main ()
No symbol table info available.