Idynamic map

339
1
07-22-2011 07:08 AM
BaluRamki
New Contributor
This is the error

System.InvalidCastException was unhandled
Message="Unable to cast COM object of type 'System.__ComObject' to interface type 'ESRI.ArcGIS.Carto.IDynamicMap'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{92191B6F-D881-4829-8B75-CE846970F67B}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."
Source="Test11"
StackTrace:
at Test11.gFeed..ctor() in C:\Users\Balu\Documents\Visual Studio 2008\Projects\GISProjectsTestB\Test11\Test11\gFeed.cs:line 71
at Test11.Form1.UserInitialization() in C:\Users\Balu\Documents\Visual Studio 2008\Projects\GISProjectsTestB\Test11\Test11\Form1.cs:line 168
at Test11.Form1..ctor() in C:\Users\Balu\Documents\Visual Studio 2008\Projects\GISProjectsTestB\Test11\Test11\Form1.cs:line 53
at Test11.Program.Main(String[] args) in C:\Users\Balu\Documents\Visual Studio 2008\Projects\GISProjectsTestB\Test11\Test11\Program.cs:line 61
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:


Got the source code form samples
error occured @ m_dynamicMap = (IDynamicMap)m_mapcontrol.Extent;
any help appreciated
0 Kudos
1 Reply
ModyBuchbinder
Esri Regular Contributor
Hi

I think it should be:
m_dynamicMap = (IDynamicMap)m_mapcontrol.Map;

Have Fun
Mody
0 Kudos