Issues with Headers

Issues with Headers

Anonymous
Not applicable
925 Views
7 Replies
Message 1 of 8

Issues with Headers

Anonymous
Not applicable

Hey All,

 

I may be messing up the includes on headers, but on a migration from OARX 2016 to OARX 2020, once I set all the includes in the project properties, all of my errors appear to be in the headers. For example, see the image.

 

Error Example.PNG

0 Likes
926 Views
7 Replies
Replies (7)
Message 2 of 8

Virupaksha_aithal
Autodesk Support
Autodesk Support

Hi,

 

I am not sure about the issue at your end. However, please refer ARX migration to 2019 once at https://www.youtube.com/watch?v=bTgmsp38kQc.

Also, try building ObjectARX SDK samples in 2020 once and see if you can build and load the samples in AutoCAD 2020. (this is to test your VS 2017 setup)

 



Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network

Message 3 of 8

Anonymous
Not applicable

I did that, and am still running into the same header problems. I am currently running my own troubleshooting to figure it out, and am worried it could be a change between the ObjectARX versions (However, I am not seeing any such changes in any documentation).

0 Likes
Message 4 of 8

autodaug
Autodesk
Autodesk

Hi, it looks like the problematic lines are where ACUI_PORT occurs, and maybe the comiler is interpreting that as the class name and getting confused because the ACUI_PORT macro isn't defined.  The macro definition is in acui.h, so maybe try including that before including acuiDialog.h.

Probably acuiDialog.h should include acui.h, since it's using its definitions..

 

0 Likes
Message 5 of 8

Anonymous
Not applicable

Hey Autodaug,

 

I tried doing that and added the include for acui, and the number of errors jumped from 50 to a hilarious number, now related to the various different acuiXXX.h files. Could it be the includes (or lacking entirely) are messed up and I need to modify them individually?

 

V.R.

Abel Garcia

0 Likes
Message 6 of 8

autodaug
Autodesk
Autodesk

Hi, I don't think you should have to modify the sdk headers. Looking at acui.h, you're right that it includes all the other acuiXXX.h and aduiXXX.h headers, if _ADESK_WINDOWS_ is defined.  So I think the expectation is that apps will just include acui.h, after including the MFC headers.  I should have noticed that before.

 

0 Likes
Message 7 of 8

tbrammer
Advisor
Advisor

Some very basic questions:

  • Do you use Visual Studio 2017?
  • Does your project use Platformtoolset "Visual Studio 2017 (v141)"?
  • Do you build a 64 bit configuration  (x64)?
  • Do you use the correct include paths to the ObjectARX 2020 SDK?
  • Did you make sure that no older ObjectARX SDK include paths can be used?
  • If your project use Property Sheets (.props files): Are they suitable for ARX 2020 / VS2017?

From your screenshot it seems that CAdUiDialog is unknown to the compiler.

The recommended way to include ARX headers is by including arxHeaders.h. This header will include all ARX headers you need. Settnig #defines like _INC_LEAGACY_HEADERS_, _AFXEXT, _RENDER_SUPPORT_ etc controls which headers are included. This is how the CAcUiDialog headers are included by arxHeaders.h:

 

//----- Autodesk MFC Extensions
#ifdef _AFXEXT
#pragma warning (disable: 4275)
#include "adui.h"
#include "aduiBaseDialog.h"
#include "aduiDialog.h"
... 
//----- AutoCAD MFC Extensions
#include "acui.h"
#include "acuiDialog.h"
...
#endif // _AFXEXT

 Do you use arxHeaders.h in your stdafx.h?


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

0 Likes
Message 8 of 8

Anonymous
Not applicable

To knock the basic questions out:

  • Yes, I am using Visual Studio 2017
  • Yes, the Platformtoolset is v141
  • I am in 64-bit configuration
  • My includes are pointing to where I have the SDK saved (C:\ObjectARX 2020\)
  • There are no older includes.
  • To my knowledge, there are no .props files causing any issues.

My stdafx.h is below.

#pragma pack (push, 8)
#pragma warning(disable: 4786 4996)
//#pragma warning(disable: 4098)

//- ObjectARX and OMF headers needs this
#include <map>

//-----------------------------------------------------------------------------
#include <afxwin.h>				//- MFC core and standard components
#include <afxext.h>				//- MFC extensions
#include <afxcmn.h>				//- MFC support for Windows Common Controls

//-----------------------------------------------------------------------------
#include "arxHeaders.h"

//-----------------------------------------------------------------------------
#include "DocData.h" //- Your document specific data class holder

//- Declare it as an extern here so that it becomes available in all modules
extern AcApDataManager<CDocData> DocVars ;

#pragma pack (pop)
0 Likes