<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How can I create a MapView control that I can consume in an MFC application in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/how-can-i-create-a-mapview-control-that-i-can/m-p/638006#M7884</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;One can normally host a WPF control in MFC using teh Interop described in like &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fweblogs.thinktecture.com%2Fcnagel%2F2010%2F04%2Fmfc-and-wpf-interop.html" rel="nofollow" target="_blank"&gt;http://weblogs.thinktecture.com/cnagel/2010/04/mfc-and-wpf-interop.html&lt;/A&gt;&lt;SPAN&gt;. &amp;nbsp;When I try this I get an exception in RuntimeCoreNet.GeneratedWrappers.CoreWrapperBase. &amp;nbsp;It appears that the .NET Runtime assumes there is some XAML to initialise the control. &amp;nbsp;Has anyone successfully hosted a Runtime MapView in an MFC application?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code snippet:&lt;/P&gt;&lt;P&gt;HWND GetHwnd(HWND parent, int x, int y, int width, int height)&lt;BR /&gt;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;System::Windows::Interop::HwndSourceParameters^ sourceParams = gcnew &amp;nbsp;&amp;nbsp;&amp;nbsp;System::Windows::Interop::HwndSourceParameters("MFCWPFApp");&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;sourceParams-&amp;gt;PositionX = x;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;sourceParams-&amp;gt;PositionY = y;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;sourceParams-&amp;gt;Height = height;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;sourceParams-&amp;gt;Width = width;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;sourceParams-&amp;gt;ParentWindow = IntPtr(parent);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;sourceParams-&amp;gt;WindowStyle = WS_VISIBLE | WS_CHILD;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Globals::gHwndSource = gcnew System::Windows::Interop::HwndSource(*sourceParams);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Globals::gwcMapView = gcnew Esri::ArcGISRuntime::UI::Controls::MapView; // Fails here with&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;// Additional information : The type initializer for 'RuntimeCoreNet.GeneratedWrappers.CoreWrapperBase' threw an &amp;nbsp;&amp;nbsp;&amp;nbsp;exception.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;FrameworkElement^ myPage = Globals::gwcMapView;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Globals::gHwndSource-&amp;gt;RootVisual = myPage;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;return (HWND)Globals::gHwndSource-&amp;gt;Handle.ToPointer();&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Dec 2016 15:30:48 GMT</pubDate>
    <dc:creator>ChrisBarrington_Brown</dc:creator>
    <dc:date>2016-12-20T15:30:48Z</dc:date>
    <item>
      <title>How can I create a MapView control that I can consume in an MFC application</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-can-i-create-a-mapview-control-that-i-can/m-p/638006#M7884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;One can normally host a WPF control in MFC using teh Interop described in like &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fweblogs.thinktecture.com%2Fcnagel%2F2010%2F04%2Fmfc-and-wpf-interop.html" rel="nofollow" target="_blank"&gt;http://weblogs.thinktecture.com/cnagel/2010/04/mfc-and-wpf-interop.html&lt;/A&gt;&lt;SPAN&gt;. &amp;nbsp;When I try this I get an exception in RuntimeCoreNet.GeneratedWrappers.CoreWrapperBase. &amp;nbsp;It appears that the .NET Runtime assumes there is some XAML to initialise the control. &amp;nbsp;Has anyone successfully hosted a Runtime MapView in an MFC application?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code snippet:&lt;/P&gt;&lt;P&gt;HWND GetHwnd(HWND parent, int x, int y, int width, int height)&lt;BR /&gt;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;System::Windows::Interop::HwndSourceParameters^ sourceParams = gcnew &amp;nbsp;&amp;nbsp;&amp;nbsp;System::Windows::Interop::HwndSourceParameters("MFCWPFApp");&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;sourceParams-&amp;gt;PositionX = x;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;sourceParams-&amp;gt;PositionY = y;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;sourceParams-&amp;gt;Height = height;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;sourceParams-&amp;gt;Width = width;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;sourceParams-&amp;gt;ParentWindow = IntPtr(parent);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;sourceParams-&amp;gt;WindowStyle = WS_VISIBLE | WS_CHILD;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Globals::gHwndSource = gcnew System::Windows::Interop::HwndSource(*sourceParams);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Globals::gwcMapView = gcnew Esri::ArcGISRuntime::UI::Controls::MapView; // Fails here with&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;// Additional information : The type initializer for 'RuntimeCoreNet.GeneratedWrappers.CoreWrapperBase' threw an &amp;nbsp;&amp;nbsp;&amp;nbsp;exception.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;FrameworkElement^ myPage = Globals::gwcMapView;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Globals::gHwndSource-&amp;gt;RootVisual = myPage;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;return (HWND)Globals::gHwndSource-&amp;gt;Handle.ToPointer();&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 15:30:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-can-i-create-a-mapview-control-that-i-can/m-p/638006#M7884</guid>
      <dc:creator>ChrisBarrington_Brown</dc:creator>
      <dc:date>2016-12-20T15:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a MapView control that I can consume in an MFC application</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-can-i-create-a-mapview-control-that-i-can/m-p/638007#M7885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you see runtime folder under your bin folder? This should contain all the needed libraries to work with runtime and if it missing, runtime wont work. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2016 12:53:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-can-i-create-a-mapview-control-that-i-can/m-p/638007#M7885</guid>
      <dc:creator>AnttiKajanus1</dc:creator>
      <dc:date>2016-12-22T12:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a MapView control that I can consume in an MFC application</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-can-i-create-a-mapview-control-that-i-can/m-p/638008#M7886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Only some were copied. &amp;nbsp;I now have a complete set and I can create a blank MapView in a dialog.&lt;/P&gt;&lt;P&gt;However, I can't create a Map or a Raster as I would expect using code like this (using namespace Esri::ArcGISRuntime)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Mapping::Map^ myMap = gcnew Mapping::Map(Mapping::Basemap::CreateStreets());&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Globals::gwcMapView-&amp;gt;Map = myMap;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Globals::myRaster = gcnew Rasters::Raster("E:\\Raw_Mapping\\Tif\\rgb\\Brisbane_Raster_250_RGB.tif");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Mapping::RasterLayer^ rasterLayer = gcnew Mapping::RasterLayer(Globals::myRaster);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In both cases the error is this (in the Map case)&lt;/P&gt;&lt;P&gt;1&amp;gt;BBTest_MFCDlg.cpp(59): error C3252: 'RuntimeCoreNet::GeneratedWrappers::CoreWrapperBase::Finalize': cannot reduce accessibility of a virtual method in a managed type&lt;BR /&gt;1&amp;gt; BBTest_MFCDlg.cpp(59): note: This diagnostic occurred while importing type 'RuntimeCoreNet::GeneratedWrappers::CoreWrapperBase ' from assembly 'Esri.ArcGISRuntime, Version=100.0.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86'.&lt;BR /&gt;1&amp;gt; BBTest_MFCDlg.cpp(59): note: This diagnostic occurred while importing type 'RuntimeCoreNet::GeneratedWrappers::CoreMap ' from assembly 'Esri.ArcGISRuntime, Version=100.0.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86'.&lt;BR /&gt;1&amp;gt; BBTest_MFCDlg.cpp(59): note: This diagnostic occurred while importing type 'Esri::ArcGISRuntime::Mapping::Map ' from assembly 'Esri.ArcGISRuntime, Version=100.0.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Searching the web for error C3252 doesn't help, and the Map (and Raster) are public so shouldn't throw this error.&lt;/P&gt;&lt;P&gt;Any clues as to how to proceed?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2016 16:24:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-can-i-create-a-mapview-control-that-i-can/m-p/638008#M7886</guid>
      <dc:creator>ChrisBarrington_Brown</dc:creator>
      <dc:date>2016-12-22T16:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a MapView control that I can consume in an MFC application</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-can-i-create-a-mapview-control-that-i-can/m-p/638009#M7887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure what is the support situation with MFC and WPF based ArcGIS Runtime integration but it has never been tested at least. I'll check out what is the situation with that and get back to you. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2016 16:41:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-can-i-create-a-mapview-control-that-i-can/m-p/638009#M7887</guid>
      <dc:creator>AnttiKajanus1</dc:creator>
      <dc:date>2016-12-22T16:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a MapView control that I can consume in an MFC application</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-can-i-create-a-mapview-control-that-i-can/m-p/638010#M7888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Can you provide me a simple solution with step by step guide how to run it? You can send it to &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:akajanus@esri.com"&gt;akajanus@esri.com&lt;/A&gt;&lt;SPAN&gt;. Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2017 10:33:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-can-i-create-a-mapview-control-that-i-can/m-p/638010#M7888</guid>
      <dc:creator>AnttiKajanus1</dc:creator>
      <dc:date>2017-01-03T10:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a MapView control that I can consume in an MFC application</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-can-i-create-a-mapview-control-that-i-can/m-p/638011#M7889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It took a while to get to the bottom of this, but we are unfortunately not able to currently support use of our SDK within an MFC app. We have an ongoing thread with Microsoft on this issue. It appears it may be a compiler problem, or similar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2017 17:14:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-can-i-create-a-mapview-control-that-i-can/m-p/638011#M7889</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2017-10-16T17:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a MapView control that I can consume in an MFC application</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-can-i-create-a-mapview-control-that-i-can/m-p/638012#M7890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Microsoft has confirmed the bug and even made a fix for an upcoming version of their compiler:&lt;/P&gt;&lt;P&gt;&lt;A href="https://connect.microsoft.com/VisualStudio/feedback/details/3145157/unexpected-c3252-error-in-c-clr-project-when-referencing-certain-net-types-with-generic-type-constraint"&gt;https://connect.microsoft.com/VisualStudio/feedback/details/3145157/unexpected-c3252-error-in-c-clr-project-when-referencing-certain-net-types-with-generic-type-constraint&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Dec 2017 04:59:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-can-i-create-a-mapview-control-that-i-can/m-p/638012#M7890</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2017-12-29T04:59:55Z</dc:date>
    </item>
  </channel>
</rss>

