PDA

View Full Version : Arx won't load



damitch725808
2012-01-29, 04:13 PM
I can't tell if this is the same problem as posted in :
http://forums.augi.com/showthread.php?t=97772
(http://forums.augi.com/showthread.php?t=97772)
I followed the advice there, but I'm still having trouble getting an arx application to load. The AutoCAD command line shows:


Command: arx

Enter an option [Files/Groups/Commands/CLasses/Services/Load/Unload]: L
捡硲湅牴偹楯瑮 not found in gisducttape.arx
AcRxDynamicLinker failed to load
'e:\cppprojects\gisducttape\release\gisducttape.arx'
C:\Program Files\Autodesk\AutoCAD Civil 3D 2011\acad.exe

Out of curiosity, I loaded that response into a hex editor, and found that the mystery characters are ANSI "acrxEntryPoint".

I compiled the arx app using Visual Studio Express 2010 - but it looks like there might be some compiler setting or such that's off - maybe? Any ideas about what could be wrong? Would it help if I posted the full generated commandline settings?

BlackBox
2012-01-30, 07:21 AM
Not sure but be sure you're compiling for the applicable .NET framework (3.5 for 2011), and set your processor 32-Bit/64-Bit, and I *believe* you need to reference the ARX AcDbMgd.dll, and AcMgd.dll (minimum).

Disclaimer - I am no ARX expert.

HTH

damitch725808
2012-01-31, 02:29 AM
Well, that would explain. I was trying out Visual Studio Express 2010, and that seems to only allow .Net 4.0. On another app, I tried switching back to .Net 3.5 and got a message that .Net 3.5 only works with VS 2005.

...So .Net is required for C++/ARX as well as for C Sharp?

BlackBox
2012-01-31, 06:04 AM
Visual Studio (Express or Pro) is required for AutoCAD development in all .NET languages; C++/ARX, C#, and VB.NET being the most common.

I use Express 2010, where each of the three I mention is a separate installation, and can produce compatible compiled code (DLL) for any AutoCAD version available today in both 32-Bit, and 64-Bit machines. The main requirements are to reference the appropriate version's AcDbMgd.dll and AcDb.dll files, and to compile to the appropriate .NET framework and processor.

This also allows for the ability to code standalone console, form, and other applications.

iRef3at
2023-06-21, 11:14 AM
I know I am 12 years late.

But, Make sure to include a proper acrxentrypoint and definition file as mentioned here.

https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-696C5565-D4F3-459A-B8AB-CA4D8736533A

- - - Updated - - -

Full explanation here (https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-696C5565-D4F3-459A-B8AB-CA4D8736533A)
Add a new C++ source file to the project and enter the following code:


#include "rxregsvc.h"
#include "acutads.h"
// Simple acrxEntryPoint code. Normally intialization and cleanup
// (such as registering and removing commands) should be done here.
//
extern "C" AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* appId)
{
switch(msg) {
case AcRx::kInitAppMsg:
// Allow application to be unloaded
// Without this statement, AutoCAD will
// not allow the application to be unloaded
// except on AutoCAD exit.
//
acrxUnlockApplication(appId);
// Register application as MDI aware.
// Without this statement, AutoCAD will
// switch to SDI mode when loading the
// application.
//
acrxRegisterAppMDIAware(appId);
acutPrintf("\nExample Application Loaded");
break;
case AcRx::kUnloadAppMsg:
acutPrintf("\nExample Application Unloaded");
break;
}
return AcRx::kRetOK;
}

The project also needs a definition file. Add a new text file to the project and name it with a .def extension.

Enter the following code in the DEF file


LIBRARY "objectarx_program_name.arx"
EXPORTS
acrxEntryPoint PRIVATE
acrxGetApiVersion PRIVATE