1. 背景
在程序中通过ShellExecute调用GoogleEarth显示位置点
2. 示例代码
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
wstring par1 = wstring(L"C:\\Learn_src\\Qt_Work_Space\\build-testOpenGooogleEarth-Desktop_Qt_5_6_2_MinGW_32bit-Debug\\gps_1048.txt(Pre).kml");
wstring par2 = wstring(L"C:\\Learn_src\\Qt_Work_Space\\build-testOpenGooogleEarth-Desktop_Qt_5_6_2_MinGW_32bit-Debug\\gps_1045.txt(Post).kml");
wstring par = par1 + wstring(L" ") + par2;
HINSTANCE ret = ShellExecute(NULL, L"open", L"C:/Program Files (x86)/Google/Google Earth/client/googleearth.exe", par.c_str(), NULL, SW_SHOWNORMAL);
if((int)ret < 32)
{
cout << "Error = " << (int)ret << endl;
cout << "Open Google Earth Application Failed !" << endl