What instanceId to pass in SimConnect_DeleteCameraInstance?

Discuss on the SimConnect SDK can be used by programmers to write add-on components for Prepar3D
Post Reply
zamirk
Posts: 132
Joined: Mon Jul 21, 2014 8:39 am

What instanceId to pass in SimConnect_DeleteCameraInstance?

Post by zamirk »

Hi,

Hope everyone is enjoying the best of life.

I am using SimConnect API for my project. I have created a camera view by calling SimConnect_CreateCameraInstance for specific AI object and then want to delete this instance, but the function doesn't return any instanceId which is required to pass in the SimConnect_DeleteCameraInstance function. If I pass 0 or requestID which was passed to the function SimConnect_CreateCameraInstance, SimConnect_DeleteCameraInstance doesn't delete the created camera instance. I have searched it in the documentation but couldn't find it.

Anyone from LM team, please guide me as I have searched a lot in the documentation and on the forum as well.

Regards,
Zamirk
zamirk
Posts: 132
Joined: Mon Jul 21, 2014 8:39 am

Re: What instanceId to pass in SimConnect_DeleteCameraInstance?

Post by zamirk »

Hi LM Team,

Is this documentation error? If so then kindly let me know how to use SIMCONNECT_DELETECAMERAINSTANCE function with SIMCONNECT_CREATECAMERAINSTANCE?

Regards,
Zamirk
MELKOR
Posts: 35
Joined: Tue Mar 15, 2016 5:25 am

Re: What instanceId to pass in SimConnect_DeleteCameraInstance?

Post by MELKOR »

Not a documentation error, but certainly an omission. The camera example code doesn't have this either. But, I did figure it out on my own by watching dispatch messages.

The camera instance id is passed to the dispatch proc via a SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID message, immediately after SimConnect_CameraCreateInstance is called, as the dwObjectId member variable.

- Bill
Post Reply