When I add AI traffic I have views for each aircraft under "AI traffic". How can I switch to that view from SimConnect. Adding AI like this:
Code: Select all
const HRESULT hr = SimConnect_AICreateNonATCAircraft(m_hSimConnect, qPrintable(modelString), qPrintable(callsign.toQString().left(12)), initialPosition, requestId);
gives me something like the "model description" + callsign as menu entry, e.g. "COMMERCIAL JET - DAMBZ". I have tried to switch to that view by "building" that string
Code: Select all
const QString viewName = "Commercial Jet-" + callsign.asString();
const char *view = viewName.toLatin1().constData();
HRESULT hr = SimConnect_ChangeView(m_hSimConnect, view);
I have tried some permutations like "callsign only", spaces around the "-" (hyphen/dash) etc. Does anybody know how what would be correct or even better how to obtain the correct view name at runtime?