<?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 Error building MFC +ATL DLL for ArcObects in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/error-building-mfc-atl-dll-for-arcobects/m-p/694305#M18620</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am upgrading a legacy ArcObjects projects to VS2013, ArcGIS10.3.1 and ArcObjectsSDKNet, while still on Win 7 Pro.&amp;nbsp; The project is a MFC DLL with ATL support, containing numerous MFC dialogs and one ATL COM class. The DLL is used by a VB.NET extension to provide custom tools for ArcMap. The extension communicates with the C++ DLL via the COM class. The model has been functioning since 2006, with upgrades along the way for ArcGIS and VS changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The MFC DLL will not build, with an error in the main.cpp:&lt;/P&gt;&lt;P&gt;error C2732: linkage specification contradicts earlier specification for 'DllGetClassObject'&lt;/P&gt;&lt;P&gt;The error references the declaration of the class in main:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,monospace; font-size: 12px;"&gt;// DllGetClassObject - Returns class factory&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono,monospace; font-size: 12px;"&gt;STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono,monospace; font-size: 12px;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono,monospace; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;AFX_MANAGE_STATE(AfxGetStaticModuleState());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono,monospace; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (S_OK == _AtlModule.GetClassObject(rclsid, riid, ppv))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono,monospace; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return S_OK;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono,monospace; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return AfxDllGetClassObject(rclsid, riid, ppv);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono,monospace; font-size: 12px;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried creating a new MFC DLL project with static link to MFC, which builds fine as is without adding anything after the solution wizard completes.&amp;nbsp; Then use class wizard to 'Add ATL support to MFC project' without changing anything else, and it fails with the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone seen this kind of error and have any ideas what it is related too? Secondly, is there a better way to write a C++ DLL that a VB extension can call into?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for any help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Dec 2016 20:06:47 GMT</pubDate>
    <dc:creator>ErikaDade</dc:creator>
    <dc:date>2016-12-07T20:06:47Z</dc:date>
    <item>
      <title>Error building MFC +ATL DLL for ArcObects</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/error-building-mfc-atl-dll-for-arcobects/m-p/694305#M18620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am upgrading a legacy ArcObjects projects to VS2013, ArcGIS10.3.1 and ArcObjectsSDKNet, while still on Win 7 Pro.&amp;nbsp; The project is a MFC DLL with ATL support, containing numerous MFC dialogs and one ATL COM class. The DLL is used by a VB.NET extension to provide custom tools for ArcMap. The extension communicates with the C++ DLL via the COM class. The model has been functioning since 2006, with upgrades along the way for ArcGIS and VS changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The MFC DLL will not build, with an error in the main.cpp:&lt;/P&gt;&lt;P&gt;error C2732: linkage specification contradicts earlier specification for 'DllGetClassObject'&lt;/P&gt;&lt;P&gt;The error references the declaration of the class in main:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,monospace; font-size: 12px;"&gt;// DllGetClassObject - Returns class factory&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono,monospace; font-size: 12px;"&gt;STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono,monospace; font-size: 12px;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono,monospace; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;AFX_MANAGE_STATE(AfxGetStaticModuleState());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono,monospace; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (S_OK == _AtlModule.GetClassObject(rclsid, riid, ppv))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono,monospace; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return S_OK;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono,monospace; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return AfxDllGetClassObject(rclsid, riid, ppv);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono,monospace; font-size: 12px;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried creating a new MFC DLL project with static link to MFC, which builds fine as is without adding anything after the solution wizard completes.&amp;nbsp; Then use class wizard to 'Add ATL support to MFC project' without changing anything else, and it fails with the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone seen this kind of error and have any ideas what it is related too? Secondly, is there a better way to write a C++ DLL that a VB extension can call into?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for any help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2016 20:06:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/error-building-mfc-atl-dll-for-arcobects/m-p/694305#M18620</guid>
      <dc:creator>ErikaDade</dc:creator>
      <dc:date>2016-12-07T20:06:47Z</dc:date>
    </item>
  </channel>
</rss>

