AutoCAD 2013/2014/2015

AutoCAD 2013/2014/2015

Reply
Member
DGProgrammer
Posts: 5
Registered: ‎04-13-2012
Message 1 of 1 (179 Views)

Wrong MFC C++ COM classes generated from acadx19.tlb?

179 Views, 0 Replies
09-07-2012 08:55 AM

Using Ms Visual Studio 2010, i've extracted COM interface (classes) from acadx19.tlb (Autocad 2013).

The strange think is that some of the classed generated are derived from CWnd and not from COleDispatchDriver as in older versions of Autocad.

 

For example, the  class extracted from TBL file for Autocad application is:

 

class IAcad19Application : public COleDispatchDriver

{

...

 LPDISPATCH GetAcadState(){...};

...

}

 

and the class extracted for AcadState is like:

 

class IAcad19State : public CWnd

{

...

BOOL get_IsQuiescent(){...};

...

}

 

In older versions of autocad IAcadXXState was a COleDispatchDriver, not a CWnd derived class. 

 

How is it possible to "cast"  the return value of GetAcadState to a IAcad19State object?

 

In older version of autocad it was easy:

 

Example:

...

IAcad19State AcadState;
AcadState.AttachDispatch(Acad19App.GetAcadState());
if (!AcadState.get_IsQuiescent())
{
    AfxMessageBox("Autocad busy",MB_OK|MB_ICONSTOP);
}

...

 

Why AcadState is generated by Visual Studio as CWnd and not COleDispatchDriver derived class??? Any idea?

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.