AutoCAD 2013/2014/2015

AutoCAD 2013/2014/2015

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

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

174 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
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.