FRX SDK Documentation 2025 SP0
Loading...
Searching...
No Matches
AcadObjectImpl.h
Go to the documentation of this file.
1#pragma once
2
3//
4// (C) Copyright 2005-2024 by Graebert GmbH.
5//
6// Permission to use, copy, modify, and distribute this software in
7// object code form for any purpose and without fee is hereby granted,
8// provided that the above copyright notice appears in all copies and
9// that both that copyright notice and the limited warranty and
10// restricted rights notice below appear in all supporting
11// documentation.
12//
13// GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
14// GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
15// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
16// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
17// UNINTERRUPTED OR ERROR FREE.
18#include <comdef.h>
19#include <comdefsp.h>
21#include "./../interfaces.h"
23#ifdef _WIN64
24#if FRX_MAJOR_VERSION >= 2024
25#include "../_impl_include/include_x64/OdaX.h"
26#else
27#include "../_impl_include/include_x64/OdaX2.h"
28#endif
29#else
30#if FRX_MAJOR_VERSION >= 2024
31#include "../_impl_include/include_x86/OdaX.h"
32#else
33#include "../_impl_include/include_x86/OdaX2.h"
34#endif
35#endif
36
37using namespace ATL;
38template<class T>
39class ATL_NO_VTABLE IOPMPropertyExtensionImpl
40 : public ICategorizeProperties
41 , public IPerPropertyBrowsing
43{
44public:
48
50 {
51 }
52
53 virtual HINSTANCE GetResourceInstance( ) = 0;
54
55 // ICategorizeProperties methods
56 STDMETHODIMP MapPropertyToCategory( DISPID dispid , PROPCAT* ppropcat )
57 {
58 return ::AcOpmMapPropertyToCategory( reinterpret_cast<IUnknown*>( this ) , T::GetOPMPropertyMap( ) , dispid , ppropcat );
59 }
60
61 STDMETHODIMP GetCategoryName( PROPCAT propcat , LCID lcid , BSTR* pbstrName )
62 {
63 return ::AcOpmGetCategoryName( reinterpret_cast<IUnknown*>( this ) , GetResourceInstance( ) , T::GetOPMPropertyMap( ) , propcat , lcid , pbstrName );
64 }
65
66 // IPerPropertyBrowsing methods
67 STDMETHODIMP GetDisplayString( DISPID dispID , BSTR *pBstr )
68 {
69 return ::AcOpmGetDisplayString( reinterpret_cast<IUnknown*>( this ) , T::GetOPMPropertyMap( ) , dispID , pBstr );
70 }
71
72 STDMETHODIMP MapPropertyToPage( DISPID dispID , CLSID *pClsid )
73 {
74 return ::AcOpmMapPropertyToPage( reinterpret_cast<IUnknown*>( this ) , T::GetOPMPropertyMap( ) , dispID , pClsid );
75 }
76
77 STDMETHODIMP GetPredefinedStrings( DISPID dispID , CALPOLESTR *pCaStringsOut , CADWORD *pCaCookiesOut )
78 {
79 return ::AcOpmGetPredefinedStrings( reinterpret_cast<IUnknown*>( this ) , GetResourceInstance( ) , T::GetOPMPropertyMap( ) , dispID , pCaStringsOut , pCaCookiesOut );
80 }
81
82 STDMETHODIMP GetPredefinedValue( DISPID dispID , DWORD dwCookie , VARIANT *pVarOut )
83 {
84 return ::AcOpmGetPredefinedValue( reinterpret_cast<IUnknown*>( this ) , T::GetOPMPropertyMap( ) , dispID , dwCookie , pVarOut );
85 }
86
87 // IOPMPropertyExtension methods
88 STDMETHODIMP GetDisplayName( DISPID dispID , BSTR *pBstr )
89 {
90 return ::AcOpmGetDisplayName( reinterpret_cast<IUnknown*>( this ) , GetResourceInstance( ) , T::GetOPMPropertyMap( ) , dispID , pBstr );
91 }
92
93 STDMETHODIMP Editable(/*[in]*/ DISPID dispID , /*[out]*/ BOOL __RPC_FAR *bEditable )
94 {
95 return ::AcOpmEditable( reinterpret_cast<IUnknown*>( this ) , T::GetOPMPropertyMap( ) , dispID , bEditable );
96 }
97
98 STDMETHODIMP ShowProperty(/*[in]*/ DISPID dispID , /*[out]*/ BOOL *pShow )
99 {
100 return ::AcOpmShowProperty( reinterpret_cast<IUnknown*>( this ) , T::GetOPMPropertyMap( ) , dispID , pShow );
101 }
102};
103
104#define ICategorizeProperties2Impl IAcPiCategorizePropertiesImpl
105template<class T>
106class ATL_NO_VTABLE IAcPiCategorizePropertiesImpl :
108{
109public:
112
114 {
115 return m_CategoryVector;
116 }
117
119 {
120 return m_CatCmdBtnVector;
121 }
122
124 {
125 if ( in.m_CatID != -1 )
126 return false;
127
128 if ( in.m_nWeight != -1 )
129 return false;
130
131 if ( in.m_ParentCatID != -1 )
132 return false;
133
134 if ( in.m_nDescId != 0 )
135 return false;
136
137 if ( in.m_nNameId != 0 )
138 return false;
139
140 return true;
141 }
142
144 {
145 if ( in.m_CatID != -1 )
146 return false;
147
148 if ( in.m_lpEnBtnBmpRes != NULL )
149 return false;
150
151 if ( in.m_nEnBtnBmpType != PICTYPE_UNINITIALIZED )
152 return false;
153
154 if ( in.m_lpDisBtnBmpRes != NULL )
155 return false;
156
157 if ( in.m_nDisBtnBmpType != PICTYPE_UNINITIALIZED )
158 return false;
159
160 if ( in.m_nStyle != NULL )
161 return false;
162
163 if ( in.m_pfnBtnProc != NULL )
164 return false;
165
166 if ( in.m_nBtnNameId != 0 )
167 return false;
168
169 return true;
170 }
171
173 {
174 m_CatCmdBtnVector.clear( );
175 m_CategoryVector.clear( );
176 int i = 0;
177 while ( !IsDefaultCmdBtnEntry( T::GetCmdBtnArray( ) [ i ] ) )
178 {
179 m_CatCmdBtnVector.push_back( T::GetCmdBtnArray( ) [ i ] );
180 i++;
181 }
182
183 i = 0;
184 while ( !IsDefaultCategoryEntry( T::GetCatArray( ) [ i ] ) )
185 {
186 m_CategoryVector.push_back( T::GetCatArray( ) [ i ] );
187 i++;
188 }
189 }
190
192 {
193 }
194
195 virtual HINSTANCE GetResourceInstance( ) = 0;
196
197 // IAcPiCategorizeProperties methods
198 STDMETHODIMP MapPropertyToCategory( DISPID dispid , PROPCAT* ppropcat )
199 {
200 return AcOpmMapPropertyToCategory( reinterpret_cast< IUnknown* >( this ) , T::GetOPMPropertyMap( ) , dispid , ppropcat );
201 }
202
203 STDMETHODIMP GetCategoryName( PROPCAT propcat , LCID lcid , BSTR* pbstrName )
204 {
205 HRESULT hr;
206 hr = AcOpmGetCategoryName( reinterpret_cast< IUnknown* >( this ) , GetResourceInstance( ) , T::GetOPMPropertyMap( ) , propcat , lcid , pbstrName );
207 if ( hr == S_FALSE ) {
208 hr = AcOpmGetCategoryName( reinterpret_cast< IUnknown* >( this ) , GetResourceInstance( ) , GetCategoryVector( ) , propcat , lcid , pbstrName );
209 }
210 return hr;
211 }
212
213 STDMETHODIMP GetCategoryDescription( PROPCAT propcat , LCID lcid , BSTR* pbstrDesc )
214 {
215 return AcOpmGetCategoryDescription( reinterpret_cast< IUnknown* >( this ) , GetResourceInstance( ) , GetCategoryVector( ) , propcat , lcid , pbstrDesc );
216 }
217
218 STDMETHODIMP GetCategoryWeight( PROPCAT CatID , long *pCategoryWeight )
219 {
220 return AcOpmGetCategoryWeight( reinterpret_cast< IUnknown* >( this ) , GetCategoryVector( ) , CatID , pCategoryWeight );
221 }
222
223 STDMETHODIMP GetParentCategory( PROPCAT CatID , PROPCAT *pParentCatID )
224 {
225 return AcOpmGetParentCategory( reinterpret_cast< IUnknown* >( this ) , GetCategoryVector( ) , CatID , pParentCatID );
226 }
227
228 STDMETHODIMP GetCommandButtons( PROPCAT CatID , VARIANT *pCatCmdBtns )
229 {
230 return AcOpmGetCategoryCommandButtons( reinterpret_cast< IUnknown* >( this ) , GetResourceInstance( ) , GetCmdBtnVector( ) , CatID , pCatCmdBtns );
231 }
232};
233
234template<class T>
235class ATL_NO_VTABLE IOPMPropertyExtensionImpl2 :
236 public IPerPropertyBrowsing ,
238{
239public:
243
245 {
246 }
247
248 virtual HINSTANCE GetResourceInstance( ) = 0;
249
250 // IPerPropertyBrowsing methods
251 STDMETHODIMP GetDisplayString( DISPID dispID , BSTR *pBstr )
252 {
253 return ::AcOpmGetDisplayString( reinterpret_cast< IUnknown* >( this ) , T::GetOPMPropertyMap( ) , dispID , pBstr );
254 }
255
256 STDMETHODIMP MapPropertyToPage( DISPID dispID , CLSID *pClsid )
257 {
258 return ::AcOpmMapPropertyToPage( reinterpret_cast< IUnknown* >( this ) , T::GetOPMPropertyMap( ) , dispID , pClsid );
259 }
260
261 STDMETHODIMP GetPredefinedStrings( DISPID dispID , CALPOLESTR *pCaStringsOut , CADWORD *pCaCookiesOut )
262 {
263 return ::AcOpmGetPredefinedStrings( reinterpret_cast< IUnknown* >( this ) , GetResourceInstance( ) , T::GetOPMPropertyMap( ) , dispID , pCaStringsOut , pCaCookiesOut );
264 }
265
266 STDMETHODIMP GetPredefinedValue( DISPID dispID , DWORD dwCookie , VARIANT *pVarOut )
267 {
268 return ::AcOpmGetPredefinedValue( reinterpret_cast< IUnknown* >( this ) , T::GetOPMPropertyMap( ) , dispID , dwCookie , pVarOut );
269 }
270
271 // IOPMPropertyExtension methods
272 STDMETHODIMP GetDisplayName( DISPID dispID , BSTR *pBstr )
273 {
274 return ::AcOpmGetDisplayName( reinterpret_cast< IUnknown* >( this ) , GetResourceInstance( ) , T::GetOPMPropertyMap( ) , dispID , pBstr );
275 }
276
277 STDMETHODIMP Editable(/*[in]*/ DISPID dispID , /*[out]*/ BOOL __RPC_FAR *bEditable )
278 {
279 return ::AcOpmEditable( reinterpret_cast< IUnknown* >( this ) , T::GetOPMPropertyMap( ) , dispID , bEditable );
280 }
281
282 STDMETHODIMP ShowProperty(/*[in]*/ DISPID dispID , /*[out]*/ BOOL *pShow )
283 {
284 return ::AcOpmShowProperty( reinterpret_cast< IUnknown* >( this ) , T::GetOPMPropertyMap( ) , dispID , pShow );
285 }
286};
287
288template <class T>
289class CProxy_AcadObjectEvents : public IConnectionPointImpl<T,&IID_IAcadObjectEvents,CComDynamicUnkArray>
290{
291public:
292
294 {
295 T* pT = static_cast<T*>( this );
296 IAcadObject* pAcadObject = static_cast<IAcadObject*>( pT );
297
298 pT->Lock( );
299 IUnknown** pp = this->m_vec.begin( );
300 while ( pp < this->m_vec.end( ) )
301 {
302 if ( *pp != NULL )
303 {
304 IAcadObjectEvents* pAcadObjectEvents = reinterpret_cast<IAcadObjectEvents*>( *pp );
305 _ASSERTE( pAcadObjectEvents != NULL );
306
307 pAcadObjectEvents->Modified( pAcadObject );
308 }
309 pp++;
310 }
311 pT->Unlock( );
312 }
313};
314
315template <class T>
317 : public IConnectionPointImpl<T , &IID_IPropertyNotifySink , CComDynamicUnkArray>
318{
319public:
321 {
322 Fire_OnChanged( DISPID_UNKNOWN );
323 }
324 void Fire_OnChanged( DISPID dispId )
325 {
326 T* pT = static_cast< T* >( this );
327 pT->Lock( );
328 IUnknown** pp = this->m_vec.begin( );
329 while ( pp < this->m_vec.end( ) )
330 {
331 IPropertyNotifySink* pNotifySink = reinterpret_cast< IPropertyNotifySink* >( *pp );
332 if ( pNotifySink )
333 pNotifySink->OnChanged( dispId );
334 pp++;
335 }
336 pT->Unlock( );
337 }
338};
339
340//
341// IAcadBaseObjectImpl is an abstract base class.
342//
343// Used to manage the AcDbObjectId and transient reactor of
344// the DB resident object. All event firing through the
345// IAcadObjectEvents interface is handled here. The CreateNewObject
346// must be implemented by the client of this class.
347//
348template <class T , const CLSID* pclsid>
349class ATL_NO_VTABLE IAcadBaseObjectImpl
350 : public IAcadBaseObject
351 , public IConnectionPointContainerImpl<T>
352 , public CProxy_AcadObjectEvents<T>
353 , public CProxy_PropertyNotifySink<T>
354{
355public:
357 {
358 }
359
360// void FinalRelease( )
361// {
362// removeAllReactors( );
363// }
364
366 {
367 }
368
370 {
371 if ( m_objId == AcDbObjectId::kNull )
372 return;
373
374 AcDbObject* pObject = m_objId.openObject( AcDb::kForRead , true );
375 if ( pObject ) // Not erased permanently
376 {
377 // get the OLE link manager and remove the link between the
378 // database resident object and this COM wrapper.
379 AcAxGetOleLinkManager( )->SetIUnknown( pObject , NULL );
380 }
381 }
382
383 virtual HRESULT CreateNewObject( AcDbObjectId& /*objId*/ , AcDbObjectId& /*ownerId*/ , TCHAR* /*keyName*/ )
384 {
385 return E_NOTIMPL;
386 }
387
388 // IAcadBaseObject
389 STDMETHOD( SetObjectId )( AcDbObjectId& objId , AcDbObjectId ownerId = AcDbObjectId::kNull , TCHAR* keyName = NULL )
390 {
391 HRESULT hr = NullObjectId( );
392 if ( FAILED( hr ) )
393 return hr;
394
395 if ( objId == AcDbObjectId::kNull )
396 {
397 hr = CreateNewObject( objId , ownerId , keyName );
398 if ( FAILED( hr ) )
399 return hr;
400 }
401
402 if ( objId != AcDbObjectId::kNull )
403 {
404 m_objId = objId;
405 }
406 return S_OK;
407 }
408
409 STDMETHOD( GetObjectId )( AcDbObjectId* objId )
410 {
411 *objId = m_objId;
412 return S_OK;
413 }
414
415 STDMETHOD( Clone )( AcDbObjectId ownerId , LPUNKNOWN* pUnkClone )
416 {
417 /* IRetrieveApplicationPtr pRApp = ( IAcadBaseObject* )this;
418 LPDISPATCH app;
419 pRApp->GetApplicationObject( &app );
420 return AcAxCopy( m_objId , app , ( LPDISPATCH* ) pUnkClone , ownerId );*/
421 return E_NOTIMPL;
422 }
423
424 STDMETHOD( GetClassID )( CLSID& clsid )
425 {
426 clsid = *pclsid;
427 return S_OK;
428 }
429
430 STDMETHOD( NullObjectId )( void )
431 {
432 if ( m_objId == AcDbObjectId::kNull )
433 return S_OK;
434 m_objId.setNull( );
435 return S_OK;
436 }
437
438 STDMETHOD( OnModified )( void )
439 {
440 this->Fire_Modified( );
441 this->Fire_OnChanged( );
442 return S_OK;
443 }
444
445 // IConnectionPointContainerImpl
446 BEGIN_CONNECTION_POINT_MAP( T )
447 CONNECTION_POINT_ENTRY( IID_IAcadObjectEvents )
448 CONNECTION_POINT_ENTRY( IID_IPropertyNotifySink )
449 END_CONNECTION_POINT_MAP( )
450
451protected:
453};
454template <class T , const CLSID* pclsid>
455class ATL_NO_VTABLE IAcadBaseObject2Impl
456 : public IAcadBaseObject2,
457 public IAcadBaseObjectImpl<T , pclsid>
458{
459public:
461 {
462 }
463
464// void FinalRelease( )
465// {
466//
467// }
468
470 {
471 }
472 STDMETHOD( SetObject )( AcDbObject*& pObj )
473 {
474 if ( pObj->objectId( ).isNull( ) )
475 {
476 this->NullObjectId( );
477 m_objRef.acquire( pObj );
478 return S_OK;
479 }
480 else
481 {
482 m_objRef.acquire( pObj->objectId( ) );
483 AcDbObjectId tmpId = pObj->objectId( );
484 return this->SetObjectId( tmpId );
485 }
486 }
487
488 void Fire_Notification( DISPID dispId = DISPID_UNKNOWN )
489 {
490 if ( m_objRef.objectId( ).isNull( ) )
491 {
492 this->Fire_Modified( );
493 this->Fire_OnChanged( dispId );
494 }
495 }
496
497 STDMETHOD( ForceDbResident )( VARIANT_BOOL* forceDbResident )
498 {
499
500 if ( NULL == forceDbResident )
501 return E_POINTER;
502
503 *forceDbResident = ACAX_VARIANT_TRUE;
504 return S_OK;
505 }
506 STDMETHOD(AddToDb)(AcDbObjectId& objId, AcDbObjectId ownerId = AcDbObjectId::kNull, ACHAR* keyName = NULL)
507 {
508 return E_NOTIMPL;
509 }
510 STDMETHOD(CreateObject)(AcDbObjectId ownerId = AcDbObjectId::kNull, ACHAR* keyName = NULL)
511 {
512 return E_NOTIMPL;
513 }
514 STDMETHOD(ObjectExists)(VARIANT_BOOL* objectExists)
515 {
516 if ( NULL == objectExists )
517 return E_POINTER;
518
519 *objectExists = m_objRef.isNull( ) ? ACAX_VARIANT_FALSE : ACAX_VARIANT_TRUE;
520 return S_OK;
521 }
522 STDMETHOD(GetObject)(AcDbObject*& pObj)
523 {
524 pObj = NULL;
525 if ( !m_objRef.objectId( ).isNull( ) )
526 return E_FAIL;
527
528 AcDbObjectId tmpId;
529 m_objRef.release( tmpId , pObj );
530 _ASSERTE( this->m_objId.isNull( ) );
531 _ASSERTE( tmpId.isNull( ) );
532 return S_OK;
533 }
534
535protected:
537};
538
539//
540// IRetrieveApplicationImpl
541//
542// Used to manage the Application interface for the objects.
543//
544class ATL_NO_VTABLE IRetrieveApplicationImpl :
545 public IRetrieveApplication
546{
547protected:
548 /* AcDbHostAppServices* hostApp( ) const
549 {
550 AcDbHostAppServices* pHostApp = 0;
551 IRetrieveHostAppServicesPtr pRetrieveHostApp = m_App;
552 if ( pRetrieveHostApp )
553 {
554 pRetrieveHostApp->GetHostAppServices( &pHostApp );
555 }
556 return pHostApp;
557 }
558 */
559public:
561 {
562 m_App = NULL;
563 }
564
566 {
567 if ( m_App != NULL )
568 m_App->Release( );
569 }
570
571 STDMETHOD( SetApplicationObject )( LPDISPATCH pApp )
572 {
573 if ( m_App != NULL )
574 return E_FAIL;
575 m_App = pApp;
576
577 // only addref if there is a valid pointer
578 if ( m_App != NULL )
579 m_App->AddRef( );
580
581 return S_OK;
582 }
583
584 // not exported via
585 STDMETHOD( GetApplicationObject )( LPDISPATCH* pApp )
586 {
587 *pApp = m_App;
588 if ( m_App == NULL )
589 return E_FAIL;
590 m_App->AddRef( );
591 return S_OK;
592 }
593
594protected:
595 IDispatchPtr GetApplicationObject( )
596 {
597 IDispatchPtr pRes;
598#ifdef _DEBUG
599 HRESULT hr =
600#endif
601 GetApplicationObject( &pRes );
602#ifdef _DEBUG
603 if ( FAILED( hr ) )
604 throw hr;
605#endif
606 return pRes;
607 }
608
609 LPDISPATCH m_App;
610};
611
612template <class C , const CLSID* pclsid , class T , const IID* piid , const GUID* plibid ,
613 WORD wMajor = 1 , WORD wMinor = 0 , class tihclass = CComTypeInfoHolder>
614 class ATL_NO_VTABLE IAcadObjectDispatchImpl
615 : public IDispatchImpl<T , piid , plibid , wMajor , wMinor , tihclass>
616 , public IAcadBaseObject2Impl<C , pclsid>
618{
619protected:
620 REFGUID defItf( ) const { return *piid; }
621 AcDbHostAppServices* hostApp( ) const { return this->m_objId == AcDbObjectId::kNull ? 0 : this->m_objId.database( )->appServices( ); }
622public:
623
627
629 {
630 }
631
632 STDMETHOD( get_Application )( LPDISPATCH* pVal )
633 {
634 return GetApplicationObject( pVal );
635 }
636
637 STDMETHOD( get_ObjectID )( LONG_PTR *pVal )
638 {
639 if ( this->m_objId == AcDbObjectId::kNull )
640 {
641 return E_FAIL;
642 }
643 *pVal = ( LONG_PTR ) ( AcDbStub* ) this->m_objId;
644 return S_OK;
645 }
646
647 STDMETHOD( get_OwnerID )( LONG_PTR *pVal )
648 {
649 return ::AcAxGetOwnerId( this->m_objId , pVal );
650 }
651
652 STDMETHOD( Delete )( )
653 {
654 HRESULT hr = ::AcAxErase( this->m_objId );
655 if ( SUCCEEDED( hr ) )
656 this->removeAllReactors( );
657 return hr;
658 }
659
660 STDMETHOD( SetXData )( VARIANT type , VARIANT data )
661 {
662 return ::AcAxSetXData( this->m_objId , type , data );
663 }
664
665 STDMETHOD( GetXData )( BSTR bstrName , VARIANT* type , VARIANT* data )
666 {
667 return ::AcAxGetXData( this->m_objId , bstrName , type , data );
668 }
669
670 STDMETHOD( get_ObjectName )( BSTR *pVal )
671 {
672 return ::AcAxGetObjectName( this->m_objId , pVal );
673 }
674
675 STDMETHOD( get_Handle )( BSTR *pVal )
676 {
677 return ::AcAxGetHandle( this->m_objId , pVal );
678 }
679
680 STDMETHOD( get_HasExtensionDictionary )( VARIANT_BOOL* bHasDictionary )
681 {
682 return ::AcAxHasExtensionDictionary( this->m_objId , bHasDictionary );
683 }
684
685 STDMETHOD( GetExtensionDictionary )( IAcadDictionary** pExtDictionary )
686 {
687 return ::AcAxGetExtensionDictionary( this->m_objId , m_App , pExtDictionary );
688 }
689
690 /*
691 this properties for compatibilities only, it not be displayed in a user-oriented browser.
692 */
693 STDMETHOD( get_Database )( IAcadDatabase** pDatabase )
694 {
695 /* if ( this->m_objId.isNull( ) || this->m_objId.database( ) == NULL )
696 {
697 return E_FAIL;
698 }
699 IUnknownPtr pUnk = ::AcAxGetIUnknownOfDatabase( this->m_objId.database( ) , m_App );
700 return pUnk->QueryInterface( IID_IAcadDatabase , ( void** ) pDatabase );*/
701 return E_NOTIMPL;
702 }
703
704 STDMETHOD( get_Document )( LPDISPATCH* pDocument )
705 {
706 if ( this->m_objId == AcDbObjectId::kNull || this->m_objId.database( ) == NULL )
707 {
708 return E_FAIL;
709 }
710
711 AcAxOleLinkManager* pOleLinkManager = AcAxGetOleLinkManager( );
712
713 _ASSERTE( pOleLinkManager != NULL );
714
715 *pDocument = pOleLinkManager->GetDocIDispatch( this->m_objId.database( ) );
716 if ( *pDocument == NULL )
717 {
718 return E_FAIL;
719 }
720
721 ( *pDocument )->AddRef( );
722 return S_OK;
723 }
724
725 //
726 // Provided for backwards compatibility; for future coding
727 // use call Delete() instead of Erase()
728 //
729 STDMETHOD( Erase )( )
730 {
731 return Delete( );
732 }
733
734 STDMETHODIMP InterfaceSupportsErrorInfo( REFIID riid )
735 {
736 static const IID* arr [ ] =
737 {
738 piid,
740 };
741 for ( int i = 0; i < sizeof( arr ) / sizeof( arr [ 0 ] ); i++ )
742 {
743 if ( InlineIsEqualGUID( *arr [ i ] , riid ) )
744 return S_OK;
745 }
746 return S_FALSE;
747 }
748};
interface IAcPiCategorizeProperties IAcPiCategorizeProperties
Definition FxPiX_i.h:155
TCHAR ACHAR
interface IAcadDictionary IAcadDictionary
Definition OdaX.h:466
interface IAcadObjectEvents IAcadObjectEvents
Definition OdaX.h:606
interface IAcadDatabase IAcadDatabase
Definition OdaX.h:60
interface IAcadObject IAcadObject
Definition OdaX.h:53
EXTERN_C const IID IID_IAcadObject
Definition OdaX.h:4014
interface IOPMPropertyExtension IOPMPropertyExtension
Definition OdaX.h:893
EXTERN_C const IID IID_IAcadObjectEvents
Definition OdaX.h:68173
ARX_API class AcAxOleLinkManager * AcAxGetOleLinkManager(void)
ARX_API long __cdecl AcOpmGetParentCategory(IUnknown *, class std::vector< struct CATEGORY_ENTRY, class std::allocator< struct CATEGORY_ENTRY > > &, int, int *)
ARX_API long __cdecl AcOpmGetCategoryCommandButtons(IUnknown *, struct HINSTANCE__ *, class std::vector< struct CATCMDBTN_ENTRY, class std::allocator< struct CATCMDBTN_ENTRY > > &, int, VARIANT *)
ARX_API long __cdecl AcOpmGetCategoryWeight(IUnknown *, class std::vector< struct CATEGORY_ENTRY, class std::allocator< struct CATEGORY_ENTRY > > &, int, long *)
ARX_API long __cdecl AcAxErase(AcAxObjectRef &)
ARX_API long __cdecl AcOpmGetCategoryName(IUnknown *, struct HINSTANCE__ *, class std::vector< struct CATEGORY_ENTRY, class std::allocator< struct CATEGORY_ENTRY > > &, int, unsigned long, BSTR *)
ARX_API long __cdecl AcOpmGetCategoryDescription(IUnknown *, struct HINSTANCE__ *, class std::vector< struct CATEGORY_ENTRY, class std::allocator< struct CATEGORY_ENTRY > > &, int, unsigned long, BSTR *)
ARX_API long __cdecl AcOpmMapPropertyToCategory(IUnknown *, struct ACAD_OPMPROPMAP_ENTRY *, long, int *)
#define ACAX_VARIANT_TRUE
Definition axtempl.h:40
#define ACAX_VARIANT_FALSE
Definition axtempl.h:41
bool isNull() const
void setNull()
static ARX_API_STATIC const AcDbObjectId kNull
AcDbDatabase * database(void) const
void Fire_OnChanged(DISPID dispId)
virtual HINSTANCE GetResourceInstance()=0
STDMETHODIMP GetParentCategory(PROPCAT CatID, PROPCAT *pParentCatID)
STDMETHODIMP GetCommandButtons(PROPCAT CatID, VARIANT *pCatCmdBtns)
STDMETHODIMP GetCategoryDescription(PROPCAT propcat, LCID lcid, BSTR *pbstrDesc)
CATCMDBTN_VECTOR & GetCmdBtnVector()
bool IsDefaultCategoryEntry(CATEGORY_ENTRY in)
STDMETHODIMP GetCategoryWeight(PROPCAT CatID, long *pCategoryWeight)
STDMETHODIMP GetCategoryName(PROPCAT propcat, LCID lcid, BSTR *pbstrName)
STDMETHODIMP MapPropertyToCategory(DISPID dispid, PROPCAT *ppropcat)
CATEGORY_VECTOR & GetCategoryVector()
bool IsDefaultCmdBtnEntry(CATCMDBTN_ENTRY in)
void Fire_Notification(DISPID dispId=DISPID_UNKNOWN)
virtual ~IAcadBaseObject2Impl()
virtual ~IAcadBaseObjectImpl()
virtual HRESULT CreateNewObject(AcDbObjectId &, AcDbObjectId &, TCHAR *)
STDMETHODIMP InterfaceSupportsErrorInfo(REFIID riid)
AcDbHostAppServices * hostApp() const
STDMETHODIMP GetDisplayName(DISPID dispID, BSTR *pBstr)
STDMETHODIMP GetPredefinedStrings(DISPID dispID, CALPOLESTR *pCaStringsOut, CADWORD *pCaCookiesOut)
virtual HINSTANCE GetResourceInstance()=0
STDMETHODIMP MapPropertyToPage(DISPID dispID, CLSID *pClsid)
STDMETHODIMP GetPredefinedValue(DISPID dispID, DWORD dwCookie, VARIANT *pVarOut)
STDMETHODIMP GetDisplayString(DISPID dispID, BSTR *pBstr)
STDMETHODIMP ShowProperty(DISPID dispID, BOOL *pShow)
STDMETHODIMP Editable(DISPID dispID, BOOL __RPC_FAR *bEditable)
STDMETHODIMP GetDisplayString(DISPID dispID, BSTR *pBstr)
STDMETHODIMP GetDisplayName(DISPID dispID, BSTR *pBstr)
virtual HINSTANCE GetResourceInstance()=0
STDMETHODIMP MapPropertyToCategory(DISPID dispid, PROPCAT *ppropcat)
STDMETHODIMP ShowProperty(DISPID dispID, BOOL *pShow)
STDMETHODIMP MapPropertyToPage(DISPID dispID, CLSID *pClsid)
STDMETHODIMP GetPredefinedValue(DISPID dispID, DWORD dwCookie, VARIANT *pVarOut)
STDMETHODIMP GetPredefinedStrings(DISPID dispID, CALPOLESTR *pCaStringsOut, CADWORD *pCaCookiesOut)
STDMETHODIMP GetCategoryName(PROPCAT propcat, LCID lcid, BSTR *pbstrName)
STDMETHODIMP Editable(DISPID dispID, BOOL __RPC_FAR *bEditable)
IDispatchPtr GetApplicationObject()
std::vector< CATCMDBTN_ENTRY > CATCMDBTN_VECTOR
Definition prop.h:246
int PROPCAT
Definition prop.h:119
std::vector< CATEGORY_ENTRY > CATEGORY_VECTOR
Definition prop.h:247
PROPCAT m_CatID
Definition prop.h:164
const ACHAR * m_lpEnBtnBmpRes
Definition prop.h:166
const ACHAR * m_lpDisBtnBmpRes
Definition prop.h:168
long m_nStyle
Definition prop.h:170
UINT m_nBtnNameId
Definition prop.h:165
UINT m_nDisBtnBmpType
Definition prop.h:169
UINT m_nEnBtnBmpType
Definition prop.h:167
BUTTONPROC m_pfnBtnProc
Definition prop.h:171
UINT m_nNameId
Definition prop.h:223
long m_nWeight
Definition prop.h:226
PROPCAT m_CatID
Definition prop.h:222
UINT m_nDescId
Definition prop.h:224
PROPCAT m_ParentCatID
Definition prop.h:225