loading the dll through arx application

loading the dll through arx application

waseefur.rahman
Advocate Advocate
1,977 Views
5 Replies
Message 1 of 6

loading the dll through arx application

waseefur.rahman
Advocate
Advocate

Hi,

I am trying to load the dll through arx application,

bool bLoads = acrxLoadModule(pathLvPty, true);

there are two dll which is being loaded in that one is successfully loaded, while other gives the error message as:
acrxGetApiVersion not found in e:\waseef\property_isolate.dll
Make sure the app links with rxapi.lib and export the symbol.AcRxDynamicLinker failed to load 'e:\waseef\property_isolate.dll
Can anyone please advice, where I need to change to load the dll successfully.

Thanks 

 

 

0 Likes
Accepted solutions (1)
1,978 Views
5 Replies
Replies (5)
Message 2 of 6

Alexander.Rivilis
Mentor
Mentor
Accepted solution

@waseefur.rahman wrote:

Hi,

I am trying to load the dll through arx application,

bool bLoads = acrxLoadModule(pathLvPty, true);

there are two dll which is being loaded in that one is successfully loaded, while other gives the error message as:
acrxGetApiVersion not found in e:\waseef\property_isolate.dll
Make sure the app links with rxapi.lib and export the symbol.AcRxDynamicLinker failed to load 'e:\waseef\property_isolate.dll
Can anyone please advice, where I need to change to load the dll successfully.

Thanks 

 

 


Both dll's are arx/dbx files? If dll is mixed/managed application you have to load it such as:

1) LoadLibrary()
2) Also acdbmgd.lib export function LoadManagedDll:
enum Acad::ErrorStatus __stdcall LoadManagedDll(ACHAR const *path);
Sample:

enum Acad::ErrorStatus __stdcall LoadManagedDll(ACHAR const *path);
static int ads_netload(void)
{
  struct resbuf *pArgs = acedGetArgs () ;
  acedRetNil();
  if (pArgs && pArgs->restype == RTSTR) {
  Acad::ErrorStatus es = LoadManagedDll(pArgs->resval.rstring);
  if (es != Acad::eOk) {
     acutPrintf(_T("\nLoadManagedDll(\"%s\")=%s"),
        pArgs->resval.rstring,acadErrorStatusText(es));
  } else 
    acedRetStr(pArgs->resval.rstring);
  } 
  return (RSRSLT) ;
}

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 3 of 6

moogalm
Autodesk Support
Autodesk Support

Hi @Alexander.Rivilis 

I feel the there is mismatch in calling convention, instead of _stdcall, it should have _cdecl, I'm not sure if this is giving a compiler error for you.

 

enum Acad::ErrorStatus __stdcall LoadManagedDll(ACHAR const *path);
static int ads_netload(void)
{

 

Message 4 of 6

Alexander.Rivilis
Mentor
Mentor

@moogalm wrote:

Hi @Alexander.Rivilis 

I feel the there is mismatch in calling convention, instead of _stdcall, it should have _cdecl, I'm not sure if this is giving a compiler error for you.

 

enum Acad::ErrorStatus __stdcall LoadManagedDll(ACHAR const *path);
static int ads_netload(void)
{

 


Man Happy

The truth is somewhere in the middle:

 

AutoCAD 2019 x86:

?LoadManagedDll@@YG?AW4ErrorStatus@Acad@@PB_W@Z (enum Acad::ErrorStatus __stdcall LoadManagedDll(wchar_t const *))

AutoCAD 2019 x64:

?LoadManagedDll@@YA?AW4ErrorStatus@Acad@@PEB_W@Z (enum Acad::ErrorStatus __cdecl LoadManagedDll(wchar_t const *))

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 5 of 6

waseefur.rahman
Advocate
Advocate

Hi Rivilis,

As when I add the Reference, it get some other error in my solution,
Could it be possible to load the Dll in command prompt itself,

I have done in .net to load the dll in command prompt itself, below is the coding.

ThisDrawing.SendCommand("FILEDIA" + vbCr & "0" + vbCr)
ThisDrawing.SendCommand("NETLOAD" + vbCr + "E:\waseef\property_isolation.dll" + vbCr)
ThisDrawing.SendCommand("FILEDIA" + vbCr & "1" + vbCr)

could you please advice how to achive the similar in C++.

Thanks 

0 Likes
Message 6 of 6

Alexander.Rivilis
Mentor
Mentor

@waseefur.rahman wrote:

Hi Rivilis,

As when I add the Reference, it get some other error in my solution,
Could it be possible to load the Dll in command prompt itself,

I have done in .net to load the dll in command prompt itself, below is the coding.

ThisDrawing.SendCommand("FILEDIA" + vbCr & "0" + vbCr)
ThisDrawing.SendCommand("NETLOAD" + vbCr + "E:\waseef\property_isolation.dll" + vbCr)
ThisDrawing.SendCommand("FILEDIA" + vbCr & "1" + vbCr)

could you please advice how to achive the similar in C++.

Thanks 


 

LoadManagedDll(L"E:\\waseef\\property_isolation.dll")

1. You have to insert definition of function LoadManagedDll as I posted above

2. You have to link with acdbmgd.lib

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member