# SDKERR\_WRONG\_USAGE (2) when attempting to call IMeetingRecordingController.StartRecording

**URL:** <https://devforum.zoom.us/t/sdkerr-wrong-usage-2-when-attempting-to-call-imeetingrecordingcontroller-startrecording/53072>\
**Category:** Windows\
**Created:** [June 24, 2021, 12:29pm UTC](https://devforum.zoom.us/t/sdkerr-wrong-usage-2-when-attempting-to-call-imeetingrecordingcontroller-startrecording/53072 "2021-06-24T12:29:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![brian.roach](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/brian.roach/32/28583_2.png) [@brian.roach](https://devforum.zoom.us/u/brian.roach)\
**Post date:** [June 24, 2021, 12:29pm UTC](https://devforum.zoom.us/t/sdkerr-wrong-usage-2-when-attempting-to-call-imeetingrecordingcontroller-startrecording/53072/1 "2021-06-24T12:29:49Z")

</div>

Starting the process of implementing Recording of session, and have the methods all implemented for Start, StartCloud, Stop, Pause and Resume - but the call to StartRecording returns an SDK error for Wrong usage (2) - can’t find any reference to that in the SDK documents and not sure what the issue is:

Here is the C++ code being used:  
bool CMeetingManager::StartScreenRecording( wchar\_t\* recPath)  
{  
if (m\_pMeetingService != nullptr)  
{  
IMeetingRecordingController\* p\_controller = m\_pMeetingService-\>GetMeetingRecordingController();  
if (p\_controller != nullptr)  
{  
time\_t timeStamp = time(nullptr);  
SDKError error = p\_controller-\>StartRecording(timeStamp, recPath);  
if (error != SDKError::SDKERR\_SUCCESS)  
{  
LOG\_ERROR \<\< "Start Recording failed, Error: " \<\< toString(error) \<\< std::endl;  
return false;  
}  
return true;  
}  
}  
}

You can see where I am getting the timeStamp to pass in here, the path is being passed down from the client layer and is in the format “C:\Users\brian.roach\OneDrive\Documents”

Not sure if that is a invalid file path or if there is an issue with the timestamp or both? I was “assuming” that maybe the incorrect usage (2) meant the second parameter was bad, but not sure.

**Which Windows Video SDK version?**  
5.5.12511.0422

**To Reproduce(If applicable)**  
For me it’s simple, just call that method.

**Screenshots**

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/e/0/e070bbaf17106b169c33b109a904cd6c4311a7d0.png)

**Device (please complete the following information):**

- Device: Dell XPS 9500
- OS: Windows 10

**Additional context**

---

<div class="post-metadata">

**Author:** ![brian.roach](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/brian.roach/32/28583_2.png) [@brian.roach](https://devforum.zoom.us/u/brian.roach)\
**Post date:** [June 24, 2021, 12:33pm UTC](https://devforum.zoom.us/t/sdkerr-wrong-usage-2-when-attempting-to-call-imeetingrecordingcontroller-startrecording/53072/2 "2021-06-24T12:33:53Z")

</div>

As an additional note, I get the exact same error when attempting to start Cloud Recording, and that takes no parameters.

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [June 24, 2021, 9:53pm UTC](https://devforum.zoom.us/t/sdkerr-wrong-usage-2-when-attempting-to-call-imeetingrecordingcontroller-startrecording/53072/3 "2021-06-24T21:53:51Z")

</div>

Hi @brian.roach, thanks for using our SDK.

Please note that I have moved this thread over to the #desktop-client-sdk:windows category.

The most common cause of this error is when you call a method at the wrong time. Can you please provide the steps taken in the meeting prior to calling this?

Thanks!

---

<div class="post-metadata">

**Author:** ![brian.roach](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/brian.roach/32/28583_2.png) [@brian.roach](https://devforum.zoom.us/u/brian.roach)\
**Post date:** [June 25, 2021, 2:07pm UTC](https://devforum.zoom.us/t/sdkerr-wrong-usage-2-when-attempting-to-call-imeetingrecordingcontroller-startrecording/53072/4 "2021-06-25T14:07:23Z")

</div>

Hey @jon.zoom - yep that was correct. We figured that bit out, and we were “recording” at the time, so it failed. Got stuck in a state where zoom thought we were still recording

So the next issue is we are using a custom UI, and now when we call RequestCustomizedLocalRecordingSource prior to recording we get that same usage error.

So to be clear, we can record, but what we end up recording is nothing…so trying to see if the issue is that we haven’t called that method to get the callback and setup things.

I’m sure we are just missing a step, but not sure where that step is.

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [June 25, 2021, 7:59pm UTC](https://devforum.zoom.us/t/sdkerr-wrong-usage-2-when-attempting-to-call-imeetingrecordingcontroller-startrecording/53072/5 "2021-06-25T19:59:14Z")

</div>

Hi @brian.roach,

Got it, thanks for clarifying. Another approach that can help with checking whether or not you can start a recording is by checking the `CanStartRecording` function.

> So the next issue is we are using a custom UI, and now when we call RequestCustomizedLocalRecordingSource prior to recording we get that same usage error.

It sounds like you are calling this before setting the `IMeetingRecordingCtrlEvent`, right? If I’m understanding that correctly, can you try calling `SetEvent` first?

Thanks!

---

<div class="post-metadata">

**Author:** ![brian.roach](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/brian.roach/32/28583_2.png) [@brian.roach](https://devforum.zoom.us/u/brian.roach)\
**Post date:** [July 1, 2021, 11:49pm UTC](https://devforum.zoom.us/t/sdkerr-wrong-usage-2-when-attempting-to-call-imeetingrecordingcontroller-startrecording/53072/6 "2021-07-01T23:49:02Z")

</div>

Hi @jon.zoom  
We figured out the issues we were having with this circumstance - going to start a new topic as we have a new question relating to the processing dialog that pops up once you stop recording. Appreciate the feedback.

---

<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:** [August 1, 2021, 9:49am UTC](https://devforum.zoom.us/t/sdkerr-wrong-usage-2-when-attempting-to-call-imeetingrecordingcontroller-startrecording/53072/7 "2021-08-01T09:49:44Z")

</div>

Closed on August 1, 2021, 9:49am UTC

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