Author Topic: Create ARX without Visual Studio?  (Read 4895 times)

0 Members and 1 Guest are viewing this topic.

Daniel Eiszele

  • Newt
  • Posts: 85
Create ARX without Visual Studio?
« on: August 24, 2010, 07:01:41 AM »
I'm hoping someone can either confirm or knock on the head the possibility of creating an ARX without the use of Visual Studio.  From my understanding an arx file is simply a windows dll with a different extension and an entry point named "acrxEntryPoint".  Could it be this simple?  As I am heavily invested in Delphi I was hoping to create the dll and then manually import the functions I need.  If I stay away from gui applications then I have no need to inherit from MFC classes (which are inaccessible from Delphi anyway).

I am all googled out on research and my attempts at banging a square peg into a round hole are thus far fruitless; any insight would be appreciated.

Regards,

Daniel

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 6940
  • AKA Daniel
Re: Create ARX without Visual Studio?
« Reply #1 on: August 24, 2010, 07:56:13 AM »
Could it be this simple? 

Unfortunately not, you need to use the same compiler that was used to create the application's SDK.

Draftek

  • Water Moccasin
  • Posts: 1501
Re: Create ARX without Visual Studio?
« Reply #2 on: August 24, 2010, 07:57:19 AM »
You don't have to use MFC.
Soli Deo Gloria

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 6940
  • AKA Daniel
Re: Create ARX without Visual Studio?
« Reply #3 on: August 24, 2010, 08:14:19 AM »
this is all you need here  :laugh:

Code: [Select]
extern "C"  int acrxEntryPoint(int msg, void* app)
{
  if(msg == AcRx::kInitAppMsg){
    acrxDynamicLinker->unlockApplication(app);
    acrxDynamicLinker->registerAppMDIAware(app);
    acedRegCmds->addCommand(_T("BrxRocks"),_T("doit"),_T("doit"), 0 , do_func);
  }
  if(msg == AcRx::kUnloadAppMsg){
    acedRegCmds->removeGroup(L"BrxRocks");
  }
  return AcRx::kRetOK;
}

If you were able to get your module loaded, you would still find it difficult to do anything meaningful

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 6940
  • AKA Daniel
Re: Create ARX without Visual Studio?
« Reply #4 on: August 24, 2010, 08:18:24 AM »

Daniel Eiszele

  • Newt
  • Posts: 85
Re: Create ARX without Visual Studio?
« Reply #5 on: August 24, 2010, 10:31:55 PM »
Could it be this simple?

Unfortunately not, you need to use the same compiler that was used to create the application's SDK.

Rats, double rats...that just makes me want to be able to do it even more!   :x

an interesting link here http://rvelthuis.de/articles/articles-cppobjs.html

Thanks Daniel, I've used Rudy's website before - very useful.

So far as I can see there are only three main ways to use Delphi to automate Bricscad/Autocad.

1.) Pure Standalone COM - Easy to do but slow because it's out of process and also because you have to run a standalone exe.
2.) Create an activex automation server and insert it into autocad/bricscad via lisp - This works well, is fast because it's in process but takes significantly more time to program.
3.) Use Delphi Prism for .NET - It is a dotnet language disguised as delphi (I don't like it  :pissed:).  The visual studio IDE just seems clunky and slow.  Having said that, Daniel M's RxNet has made using it in Bricscad possible  which I am thankful for.

I might note that all of my development has been for in house purposes only so it doesn't really matter what work arounds I take; it would just be nice to do something cleanly for once :)

@Daniel - With regards to your RxNet application; (theorizing here) would it be possible to write a similar loader that say ran a designated function inside a windows dll (eg Execute, ListCommands etc).  I have also noted that Delphi now supports class attributes like .NET so maybe this would be an entry point? <-- Please note not asking for the coding just wondering if you thought it was possible.

Sorry if this is has moved off topic.

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9263
Re: Create ARX without Visual Studio?
« Reply #6 on: August 24, 2010, 10:52:22 PM »
Spitballin': I think i remember CB telling me that you can use the Digital Mars compiler.
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

LE3

  • Guest
Re: Create ARX without Visual Studio?
« Reply #7 on: August 24, 2010, 11:01:07 PM »
Spitballin': I think i remember CB telling me that you can use the Digital Mars compiler.
I recall some arx info that he provided, about how to compile them without visual studio, to bad I lost those docs...

Draftek

  • Water Moccasin
  • Posts: 1501
Re: Create ARX without Visual Studio?
« Reply #8 on: August 27, 2010, 10:56:20 AM »
Speaking of Cornbread - anyone know how to get in touch with him.
I've lost his phone # and email address.

I'd like to pass on some info to RR.
Soli Deo Gloria

mmamkin

  • Guest
Re: Create ARX without Visual Studio?
« Reply #9 on: September 02, 2010, 11:13:53 PM »
I'm hoping someone can either confirm or knock on the head the possibility of creating an ARX without the use of Visual Studio.
Note, that AutoCAD checks "Linker version" field in PE-header of ARX-modules (you can see that header with PE-Explorer),
so if you fill that field with correct value (eg. 8 for acad.17 as I remember) and your dll exports acrxGetApiVersion and acrxEntryPoint, then AutoCAD should be happy
I remember that ~8-10 years ago there were Delphi-components or units to write ARX-dll's, but that project seems to be dead
I forgot to add, that you should keep in mind using the same version of MS CRT (or not use it totally)
« Last Edit: September 02, 2010, 11:21:36 PM by mmamkin »

Daniel Eiszele

  • Newt
  • Posts: 85
Re: Create ARX without Visual Studio?
« Reply #10 on: September 02, 2010, 11:52:15 PM »
Thanks mmamkin, sounds like my arx hacking project isn't over yet after all.  Having said that, I have now found out how to make a true COM addin so the necessity of an ARX hook isn't so urgent.  Not to mention that the same theory holds true for writing addins for Microsoft Office and any number of other programs.  Happy Days!