<?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 Re: identifier AttachToAllItems is undefined in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/identifier-AttachToAllItems-is-undefined/m-p/378155#M819</link>
    <description>&lt;P&gt;To be able to&amp;nbsp; use AttachToAllItems function your&amp;nbsp; class needs&amp;nbsp; to inherit from&amp;nbsp; DG::CompoundItemObserver&lt;/P&gt;</description>
    <pubDate>Fri, 28 Apr 2023 10:06:46 GMT</pubDate>
    <dc:creator>julienK</dc:creator>
    <dc:date>2023-04-28T10:06:46Z</dc:date>
    <item>
      <title>identifier AttachToAllItems is undefined</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/identifier-AttachToAllItems-is-undefined/m-p/378103#M818</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[AC24, VS 2017]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am stumped on this.&amp;nbsp; I have successfully used dialogs in other Add_Ons.&amp;nbsp; I am using a working, previous project as a go-by for this new one.&amp;nbsp; Maybe that's my problem, but it is not clear to me how slight differences would impact.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, I have created a blank dialog with only an 'OK' button to test my proof of concept.&amp;nbsp; It will eventually be employed to alert the users if they should open a .bpn file.&lt;BR /&gt;&lt;BR /&gt;in the .grc file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#include "JHP_AutoLoadResIDs.hpp"

'GDLG' 32500  Modal	0	0  1000  1000	"JHP:  ERROR - Do not open .bpn file" {
/* [  1] */ Button	400  300   70   43		LargePlain	"OK"
}

'DLGH'  32500  DLG_32500_JHP_AUTOLOAD {
1	"JHP_OK"	Button_0
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;in the .hpp file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#pragma once

#ifndef JHP_AUTOLOAD_DIALOG_HPP
#define JHP_AUTOLOAD_DIALOG_HPP

#include	"DGModule.hpp"

class JHP_AutoLoad_Dialog :	public DG::ModalDialog,
				public DG::ButtonItemObserver
{
protected:
	enum Controls {
		OkID = 1
	};

	DG::Button OK_Button;
	virtual void ButtonClicked(const DG::ButtonClickEvent&amp;amp; ev) override;
public:
	JHP_AutoLoad_Dialog();
	~JHP_AutoLoad_Dialog();
};

#endif JHP_AUTOLOAD_DIALOG_HPP&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the .cpp file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;JHP_AutoLoad_Dialog::JHP_AutoLoad_Dialog() :
	DG::ModalDialog(ACAPI_GetOwnResModule(), 32500, ACAPI_GetOwnResModule()),
	OK_Button(GetReference(), OkID)
{
	AttachToAllItems(*this);
}

JHP_AutoLoad_Dialog::~JHP_AutoLoad_Dialog()
{
}

void JHP_AutoLoad_Dialog::ButtonClicked(const DG::ButtonClickEvent&amp;amp; ev)
{
	if (ev.GetSource() == &amp;amp;OK_Button)
	{
		PostCloseRequest(Cancel);
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It is here where the problem is&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MudratDetector_0-1682630901388.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/36599iF25018E54F668B1B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MudratDetector_0-1682630901388.png" alt="MudratDetector_0-1682630901388.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to remedy this by:&lt;BR /&gt;- - making sure of necessary #include directives&lt;/P&gt;&lt;P&gt;- - rearranging chunks of code to influence definition&lt;BR /&gt;&lt;BR /&gt;The main difference I see between this failed&amp;nbsp;AttachToAllItems and the one that works in my go-by is that this Add-On does not provide a menu selection.&amp;nbsp; It only establishes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;err = ACAPI_Notify_CatchProjectEvent(APINotify_Open, JHP_EventHandler);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// -----------------------------------------------------------------------------
// Initialize
//		called after the Add-On has been loaded into memory
// -----------------------------------------------------------------------------

GSErrCode __ACENV_CALL	Initialize (void)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This strategy of organization is working with calls to a typical&amp;nbsp;ACAPI_WriteReport("message", true);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Could this placement of&amp;nbsp;ACAPI_Notify_CatchProjectEvent in&amp;nbsp;__ACENV_CALL Initialize be the cause?&lt;BR /&gt;Am I missing an #include?&lt;/P&gt;&lt;P&gt;New laptop - Am I missing something in my VS install/configuration?&lt;/P&gt;&lt;P&gt;Have I provided enough detail?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to all that look and many thanks to all that answer,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 23:31:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/identifier-AttachToAllItems-is-undefined/m-p/378103#M818</guid>
      <dc:creator>MudratDetector</dc:creator>
      <dc:date>2023-04-27T23:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: identifier AttachToAllItems is undefined</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/identifier-AttachToAllItems-is-undefined/m-p/378155#M819</link>
      <description>&lt;P&gt;To be able to&amp;nbsp; use AttachToAllItems function your&amp;nbsp; class needs&amp;nbsp; to inherit from&amp;nbsp; DG::CompoundItemObserver&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 10:06:46 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/identifier-AttachToAllItems-is-undefined/m-p/378155#M819</guid>
      <dc:creator>julienK</dc:creator>
      <dc:date>2023-04-28T10:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: identifier AttachToAllItems is undefined</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/identifier-AttachToAllItems-is-undefined/m-p/378177#M820</link>
      <description>&lt;P&gt;Brilliant!&amp;nbsp; Thanks for the response that was right on target.&lt;BR /&gt;- Chris&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MudratDetector_1-1682710582132.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/36626i005C4CD139D792BA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MudratDetector_1-1682710582132.png" alt="MudratDetector_1-1682710582132.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MudratDetector_0-1682710494394.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/36625i4CC312393BF0332E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MudratDetector_0-1682710494394.png" alt="MudratDetector_0-1682710494394.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 19:36:36 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/identifier-AttachToAllItems-is-undefined/m-p/378177#M820</guid>
      <dc:creator>MudratDetector</dc:creator>
      <dc:date>2023-04-28T19:36:36Z</dc:date>
    </item>
  </channel>
</rss>

