• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Problem with TransmitClientEvent()

Messages
516
I'm trying to use SimConnect_TransmitClientEvent() to set the zoom using the VIEW1_ZOOM_SET event and not having any luck.

Working from the examples given in the SimConnect SDK doc, here's my code:

My definition:

static enum EVENT_ID {
EVENT_SET_ZOOM
};

After SimConnect connects I do:

hr = SimConnect_MapClientEventToSimEvent(mhSimConnect, EVENT_SET_ZOOM, "VIEW1_ZOOM_SET");

Then upon command I issue:

hr = SimConnect_TransmitClientEvent(mhSimConnect, 0, EVENT_SET_ZOOM, 64 , SIMCONNECT_GROUP_PRIORITY_DEFAULT, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);

This should set the zoom to 1x but it does nothing. hr returns as S_OK to all my functions and I know SimConnect is working as other functions work ok.

Any ideas? BTW, this is a local client application. I've tried the same code to do other things like raise or lower the gear and that's not working either, so I think it's code specific rather than to do with this particular event.

Thanks,

Si
 
I've kind of got it to work. I had to raise the priority to SIMCONNECT_GROUP_PRIORITY_HIGHEST and change the event to VIEW_ZOOM_SET.

The problem with that is that I only want to change the zoom if the user has the VC in focus. VIEW1_ZOOM_SET doesn't seem to work at all, which is weird as it's documented in Dai's C gauge book as a key event and I've seen Pete Dowson mention in it a thread on Avsim.

Si
 
I've kind of got it to work. I had to raise the priority to SIMCONNECT_GROUP_PRIORITY_HIGHEST and change the event to VIEW_ZOOM_SET.

I've never found a "VIEW_ZOOM_SET"!? FSUIPC4 certainly uses VIEW1_ZOOM_SET when an application writes to offset 02B2, and that seems to work okay. I don't use "DEFAULT" priority at all though -- for many events that doesn't get to the parts of FSX which need it.

Regards

Pete
 
That's odd. I blindly tried it amongst several combinations, including VIEW_ZOOM_SET1 and VIEW_ZOOM_SET:1 and it was the only one I got to work. I don't know why VIEW1_ZOOM_SET wont work in my application. (Using FSX Acceleration and matching SDK.)

Si
 
That's odd. I blindly tried it amongst several combinations, including VIEW_ZOOM_SET1 and VIEW_ZOOM_SET:1 and it was the only one I got to work. I don't know why VIEW1_ZOOM_SET wont work in my application. (Using FSX Acceleration and matching SDK.)

Hmm. Maybe I've not tried it since Acceleration came out. I'll check it. Certainly "VIEW1_ZOOM_SET" is accepted as an Event name without rejection. I'll try it now ...

... Aha! You are right. MS sneakily changed its name from VIEW1 ZOOM SET to VIEW ZOOM SET. It is actually listed as such now in the FSUIPC assignment dropdowns. The assigned KEY_EVENT number (FS control number) is the same still: 65701.

I never noticed because FSUIPC doesn't actually have the names of any of the FS Events (or Controls as I call them) built in, it gets them all the same way it always has, in all versions of FS, from the control table in CONTROLS.DLL.

Internally I use the numbers, and in fact define the controls by their control numbers in my MapClientEventToSimEvent calls -- daft, isn't it? I use the same numbers as FS does internally, but I have to tell SimConnect to translate that number into a string which it has to look up in CONTROLS.DLL to convert back to the same number I want to use! ;-)

Pete
 
Last edited:
Back
Top