acrxGetApiVersion not found?

acrxGetApiVersion not found?

Anonymous
Not applicable
3,733 Views
6 Replies
Message 1 of 7

acrxGetApiVersion not found?

Anonymous
Not applicable
Hi all, I am a beginner of objectARX.
I had created two simple project using ObjectARX wizard, one for ARX and another one for DBX. After implement a custom entity in DBX project, I reference this custom entity in a command inside the ARX project. So I add a dependency from ARX to DBX in the property sheet of solution.
Finally I load these modules in AutoCAD(of coz, DBX first and ARX later), it tells me a fail message as below:
/ ================================
| acrxGetApiVersion not found in E:\......\TonyCustEntityARX.arx
| Make sure the app links with rxapi.lib and export the symbol.AcRxDynamicLinker
| failed to load 'E:\......\TonyCustEntityARX.arx'
| D:\.......\acad.exeUnable to load TonyCustEntityARX.arx file.
\ =================================
It seems lack of exporting acrxGetApiVersion method, and it is confirmed after I checked the export section of .arx file, there was only acrxEntryPoint exported.

What should I do with this situation?

P.S. if remove the dependency from ARX to DBX, everything works as it should be, and I checked the export section of .arx file, there is an acrxGetApiVersion there.


P.S.2 I had tried to add a .def file to export acrxGetApiVersion method, as below:
/ =======================================
| LIBRARY TonyCustEntityARX
| ;--------------------------------------
|
| EXPORTS
| acrxGetApiVersion PRIVATE
\ ========================================
and I get a different fail messenage which made me very depressed:
/ =========================================
| TonyCustEntityARX.arx is incompatible with this version of AutoCAD.
| AcRxDynamicLinker failed to load 'E:\.....\TonyCustEntityARX.arx'
| D:\.....\acad.exeUnable to load TonyCustEntityARX.arx file.
\ =========================================
any reply will be appreciated.

Findekano
0 Likes
3,734 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
well, I found that the ARXWizard dont generate .def file for project. after I added a .def file to DBX file, and export acrxGetApiVersion method, the issue was defeated.
However, is there anyone kind enough to tell me why the wizard doesn't generate .def file(I guess the project use __declspec(dllexport) instead, but why is doesnt works at this place?), and where the acrxGetApiVersion function is implemented?
0 Likes
Message 3 of 7

KrishnaK
Archived Account
You are right the wizard does away with a *.DEF file so that you have one less file to maintain. It does it by declspec dllexport for acrxEntryPoint. For acrxGetApiVersion, it does it by pragma include. This fails because the definition for this function is found elsewhere in one of the dependent modules - so the function simply is not exported.
The fix is any one of the three:
1. create a Def file (the whole purpose is lost anyway)
2. include this line for acrxGetApiVersion export.
#pragma comment(linker, "/export:_acrxGetApiVersion,PRIVATE")
3. just make sure to import your libraries after the AutoCAD ones
#include "ArxHeaders.h"
then #pragma comment (lib...) for your module

Hope this helped.

Krishna Kalvai
Developer Technical Services,
Autodesk
0 Likes
Message 4 of 7

KrishnaK
Archived Account
By the way, this is a known problem and will be fixed in the next release of the wizard.
0 Likes
Message 5 of 7

Anonymous
Not applicable
KrishnaK:

I'm having a similar problem with a C# dll I created. When I try to use the ARX to load the dll i get the message:

acrxGetApiVersion not found in C:\Program Files\AutoCAD 2007\CsMgdAcad1.dll
Make sure the app links with rxapi.lib and export the symbol.AcRxDynamicLinker
failed to load 'CsMgdAcad1.dll'
C:\Program Files\AutoCAD 2007\acad.exe

I'm using this to load the dll:

acrxDynamicLinker->loadModule(L"CsMgdAcad1.dll", 1, 0);


Where must I add the #pragma comment(.... line that you mentioned?
0 Likes
Message 6 of 7

Anonymous
Not applicable
Does anyone know how to solve this problem? I created a different DLL, now from Visual Basic, and tried to load it in the acrxEntryPoint of my ARX. I keep getting the same error message from AutoCAD:

acrxGetApiVersion not found in C:\Program Files\AutoCAD 2007\Project1.dll
Make sure the app links with rxapi.lib and export the symbol.AcRxDynamicLinker
failed to load 'Project1.dll'
C:\Program Files\AutoCAD 2007\acad.exe

How can I solve this? Is the problem in the created DLLs, in the ARX, in the instruction for loading the module...?

All help is welcome.

Leon David
0 Likes
Message 7 of 7

Anonymous
Not applicable
> I created a different DLL, now from Visual Basic, and tried to
> load it in the acrxEntryPoint of my ARX.

The error indicates that you're trying to load it as an ARX module. Use
LoadLibrary() to load a standard DLL. 🙂
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes