// TerraExplorerShowcase.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#import "c:\Program Files (x86)\Skyline\TerraExplorer\TerraExplorerX.dll" no_namespace, named_guids
int _tmain(int argc, _TCHAR* argv[])
{
CoInitialize(NULL);
{
try
{
ISGWorld66Ptr pISGWorld;
pISGWorld.CreateInstance(CLSID_SGWorld66);
pISGWorld->Project->Open("https://www.skylinesoft.com/SkylineGlobe/WebClient/PresentationLayer/WebClient/SkyglobeLB.fly",FALSE,"","");
IPosition66Ptr pIPosition66 = pISGWorld->Creator->CreatePosition(-77.036667, 38.895111, 1500,AltitudeTypeCode::ATC_TERRAIN_RELATIVE,0,0,0,0);
pISGWorld->Navigate->FlyTo(_variant_t((IDispatch*)pIPosition66),ActionCode::AC_FLYTO);
}
catch( _com_error &e )
{
// Crack _com_error
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
_tprintf( _T("Exception thrown for classes generated by #import") );
_tprintf( _T("\tCode = %08lx\n"), e.Error());
_tprintf( _T("\tCode meaning = %s\n"), e.ErrorMessage());
_tprintf( _T("\tSource = %s\n"), (LPCTSTR) bstrSource);
_tprintf( _T("\tDescription = %s\n"), (LPCTSTR) bstrDescription);
}
}
CoUninitialize();
return 0;
}