<?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 MFC - IMPLEMENT_DYNCREATE() creates error in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MFC-IMPLEMENT-DYNCREATE-creates-error/m-p/856474#M2122</link>
    <description>Hey there,&lt;BR /&gt;&lt;BR /&gt;I'm trying to create a class that inherits from two other classes. Both these two MFC classes also inherit from a common type:&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;class c1 : public CWnd { ... };&lt;BR /&gt;class c2 : &lt;/B&gt;&lt;B&gt;public &lt;/B&gt;&lt;B&gt;CWnd { ... };&lt;BR /&gt;&lt;BR /&gt;class c3 : &lt;/B&gt;&lt;B&gt;public &lt;/B&gt;&lt;B&gt;c1, &lt;/B&gt;&lt;B&gt;public &lt;/B&gt;&lt;B&gt;c2 { ... DECLARE_DYNCREATE(c3) ... };&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;IMPLEMENT_DYNCREATE(c3, c1) // error C2594: 'return' : ambiguous conversions from 'c3 *' to 'CObject *'&lt;BR /&gt;&lt;BR /&gt;&lt;/B&gt;&lt;B&gt;IMPLEMENT_DYNCREATE(c3, &lt;/B&gt;&lt;B&gt;CWnd&lt;/B&gt;&lt;B&gt;) // ALSO error C2594: 'return' : ambiguous  conversions from 'c3 *' to 'CObject *'&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;I looked over IMPLEMENT_DYNCREATE() but couldn't understand what it meant or how to fix it.&lt;BR /&gt;I will try experimenting with different ways to fix this in the mean time.&lt;BR /&gt;Thanks in advance for any help.&lt;BR /&gt;&lt;BR /&gt;-Steve</description>
    <pubDate>Wed, 31 Mar 2010 18:00:45 GMT</pubDate>
    <dc:creator>stephen-smolley</dc:creator>
    <dc:date>2010-03-31T18:00:45Z</dc:date>
    <item>
      <title>MFC - IMPLEMENT_DYNCREATE() creates error</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MFC-IMPLEMENT-DYNCREATE-creates-error/m-p/856474#M2122</link>
      <description>Hey there,&lt;BR /&gt;&lt;BR /&gt;I'm trying to create a class that inherits from two other classes. Both these two MFC classes also inherit from a common type:&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;class c1 : public CWnd { ... };&lt;BR /&gt;class c2 : &lt;/B&gt;&lt;B&gt;public &lt;/B&gt;&lt;B&gt;CWnd { ... };&lt;BR /&gt;&lt;BR /&gt;class c3 : &lt;/B&gt;&lt;B&gt;public &lt;/B&gt;&lt;B&gt;c1, &lt;/B&gt;&lt;B&gt;public &lt;/B&gt;&lt;B&gt;c2 { ... DECLARE_DYNCREATE(c3) ... };&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;IMPLEMENT_DYNCREATE(c3, c1) // error C2594: 'return' : ambiguous conversions from 'c3 *' to 'CObject *'&lt;BR /&gt;&lt;BR /&gt;&lt;/B&gt;&lt;B&gt;IMPLEMENT_DYNCREATE(c3, &lt;/B&gt;&lt;B&gt;CWnd&lt;/B&gt;&lt;B&gt;) // ALSO error C2594: 'return' : ambiguous  conversions from 'c3 *' to 'CObject *'&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;I looked over IMPLEMENT_DYNCREATE() but couldn't understand what it meant or how to fix it.&lt;BR /&gt;I will try experimenting with different ways to fix this in the mean time.&lt;BR /&gt;Thanks in advance for any help.&lt;BR /&gt;&lt;BR /&gt;-Steve</description>
      <pubDate>Wed, 31 Mar 2010 18:00:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MFC-IMPLEMENT-DYNCREATE-creates-error/m-p/856474#M2122</guid>
      <dc:creator>stephen-smolley</dc:creator>
      <dc:date>2010-03-31T18:00:45Z</dc:date>
    </item>
    <item>
      <title>MFC - IMPLEMENT_DYNCREATE() creates error</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MFC-IMPLEMENT-DYNCREATE-creates-error/m-p/856475#M2123</link>
      <description>Fixed.&lt;BR /&gt;&lt;BR /&gt;Replace IMPLEMENT_DYNCREATE with IMPLEMENT_DYNCREATE_REINTERPRET and define the following:&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;#define IMPLEMENT_DYNCREATE_REINTERPRET(class_name, base_class_name) \&lt;BR /&gt; CObject* PASCAL class_name::CreateObject() \&lt;BR /&gt; { return reinterpret_cast&lt;COBJECT&gt;(new class_name); } \&lt;BR /&gt; IMPLEMENT_RUNTIMECLASS(class_name, base_class_name, 0xFFFF, \&lt;BR /&gt; class_name::CreateObject, NULL)&lt;/COBJECT&gt;&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;I feel kind of dumb that the solution seems to be this simple. At least someone else can benefit from this potentially.&lt;BR /&gt;Thanks anyway!&lt;BR /&gt;&lt;BR /&gt;-Steve</description>
      <pubDate>Wed, 31 Mar 2010 18:15:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MFC-IMPLEMENT-DYNCREATE-creates-error/m-p/856475#M2123</guid>
      <dc:creator>stephen-smolley</dc:creator>
      <dc:date>2010-03-31T18:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: MFC - IMPLEMENT_DYNCREATE() creates error</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MFC-IMPLEMENT-DYNCREATE-creates-error/m-p/1464727#M8203</link>
      <description>&lt;P&gt;It worked! But I had to modify to:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="4"&gt;#define IMPLEMENT_DYNCREATE_REINTERPRET(class_name, base_class_name) \&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="4"&gt;CObject* PASCAL class_name::CreateObject() \&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="4"&gt;{ return reinterpret_cast&amp;lt;base_class_name*&amp;gt;(new class_name); } \&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="4"&gt;IMPLEMENT_RUNTIMECLASS(class_name, base_class_name, 0xFFFF, \&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="4"&gt;class_name::CreateObject, NULL)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Mar 2023 16:31:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/MFC-IMPLEMENT-DYNCREATE-creates-error/m-p/1464727#M8203</guid>
      <dc:creator>PauloEP</dc:creator>
      <dc:date>2023-03-12T16:31:44Z</dc:date>
    </item>
  </channel>
</rss>

