This is my first post here. I am new to COM, but I have read through many postings trying to get to the bottom of this, to no avail. Here is my problem.
I get the error Run Time Error #0, value of ESP not properly saved.......
From what I can tell, there are two possible causes.
1. In the advanced tab, there are the calling options. cdecl, stdcall, etc....
Everything in every project is set to cdecl, so I don't think that is it.
2. Typecasting or otherwise improper variable initialization/casting.
Maybe. I don't know the first thing about COM, so maybe this is really dumb. This is code that used to work, and all of a sudden doesn't.
Expand|Select|Wrap|Line Numbers
- void GetPFPSDataPaths(std::vector<std::string> &aDataPaths)
- {
- aDataPaths.clear();
- CoInitialize(0);
- bool ComEstablished(true);
- try
- {
- HRESULT hr;
- // Create our COM objects
- IMapSeriesRowsetPtr spMapSeries;
- hr = spMapSeries.CreateInstance(__uuidof(MapSeriesRowset));
- if (hr != S_OK)
- throw _com_error(hr);
- ICoverageRowsetPtr spCoverage;
- hr = spCoverage.CreateInstance(__uuidof(CoverageRowset));
- if (hr != S_OK)
- throw _com_error(hr);
- IDataSourcesRowsetPtr spDataSources;
- hr = spDataSources.CreateInstance(__uuidof(DataSourcesRowset));
- if (hr != S_OK)
- throw _com_error(hr);
- I use the spDataSources for lots of things, and all is well. Then, these few lines happen:
- // attempt to grab all paths from the map data manager
- spCoverage->Initialize("cadrg");
- hr = spDataSources->SelectAll(TRUE);
Is there a problem with how I initialized the spDataSources?
Any other ideas?
Thanks,
Grommit.