# Sample code for initializing returns error code ZoomVideoSDKErrors\_Wrong\_Usage

**URL:** <https://devforum.zoom.us/t/sample-code-for-initializing-returns-error-code-zoomvideosdkerrors-wrong-usage/72992>\
**Category:** Windows\
**Created:** [July 26, 2022, 3:42pm UTC](https://devforum.zoom.us/t/sample-code-for-initializing-returns-error-code-zoomvideosdkerrors-wrong-usage/72992 "2022-07-26T15:42:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![drpclind](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/drpclind/32/19031_2.png) [@drpclind](https://devforum.zoom.us/u/drpclind)\
**Post date:** [July 26, 2022, 3:42pm UTC](https://devforum.zoom.us/t/sample-code-for-initializing-returns-error-code-zoomvideosdkerrors-wrong-usage/72992/1 "2022-07-26T15:42:11Z")

</div>

**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](https://marketplace.zoom.us/docs/sdk/video/windows/essential/initialize/#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.

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [August 3, 2022, 1:19am UTC](https://devforum.zoom.us/t/sample-code-for-initializing-returns-error-code-zoomvideosdkerrors-wrong-usage/72992/2 "2022-08-03T01:19:46Z")

</div>

Hi @drpclind ,

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

Thanks,  
Gianni

---

<div class="post-metadata">

**Author:** ![drpclind](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/drpclind/32/19031_2.png) [@drpclind](https://devforum.zoom.us/u/drpclind)\
**Post date:** [August 9, 2022, 6:24pm UTC](https://devforum.zoom.us/t/sample-code-for-initializing-returns-error-code-zoomvideosdkerrors-wrong-usage/72992/3 "2022-08-09T18:24:22Z")

</div>

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](https://devforum.zoom.us/t/error-13023-authret-keyorsecretwrong/37268/8) 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](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.

---

<div class="post-metadata">

**Author:** ![drpclind](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/drpclind/32/19031_2.png) [@drpclind](https://devforum.zoom.us/u/drpclind)\
**Post date:** [August 29, 2022, 6:00pm UTC](https://devforum.zoom.us/t/sample-code-for-initializing-returns-error-code-zoomvideosdkerrors-wrong-usage/72992/4 "2022-08-29T18:00:19Z")

</div>

I was able to resolve the problem by switching from MinGW to MSVC. Disappointing, but manageable.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [September 29, 2022, 4:01am UTC](https://devforum.zoom.us/t/sample-code-for-initializing-returns-error-code-zoomvideosdkerrors-wrong-usage/72992/5 "2022-09-29T04:01:10Z")

</div>

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