sjett

Connect to Esri map service using c++ in stand alone desktop app

Discussion created by sjett on Jun 26, 2012
Can anyone tell me how to do this?  Here is my code.  The Open call returns E_INVALIDARG.

IAGSServerConnectionFactoryPtr AGSConnectionFactory;
AGSConnectionFactory.CreateInstance(CLSID_AGSServerConnectionFactory);
IPropertySetPtr connectionProps;
connectionProps.CreateInstance(CLSID_PropertySet);

VARIANT TestURL = _variant_t("http://server.arcgisonline.com/arcgis/services/");
hr = connectionProps->SetProperty(BSTR("connectiontype"), _variant_t(esriAGSConnectionTypeInternet));
hr = connectionProps->SetProperty(BSTR("url"), TestURL);

IAGSServerConnectionPtr AGSConnection;
AGSConnection.CreateInstance(CLSID_AGSServerConnection);
hr = AGSConnectionFactory->Open(connectionProps, 0, &AGSConnection);

Outcomes