Page 1 of 1

PostPosted: Fri Feb 17, 2006 11:36 am
by David A. Giesselman
Hello Pietro and welcome!

Building ARROW.DPR should yield the file ARROW.DMX which can be loaded via the Macros button from the main Edit menu.

Regards,
Dave

PostPosted: Fri Feb 17, 2006 3:13 pm
by devinder
Under Delphi, Click Project-Options. This will bring up a dialog box. Under Application TAB, locate "Output settings" group box and Enter ".dmx" for "target file extension" without quotes. This will yield dmx when you compile the source code, instead of regular DLL and will also help you if you wish you debug your Macro at run-time using Run-Parameters and defining DCADWIN.EXE as the Host Application. A couple of small things to remember when trying to debug
1. the DMX has to be in the same directory as its DPR file (in other words: don't have a separate output directory)
2. your project path should not contain directories with a space in the name. There seems to be a problem with debugging DLLs with spaces in the project path.

Also Renaming DLL to DMX should run the Macro.

Hope this helps.

PostPosted: Fri Feb 17, 2006 5:15 pm
by Greg Blandin
devinder wrote:Also Renaming DLL to DMX should run the Macro.


:shock:

Wha?

PostPosted: Fri Feb 17, 2006 5:37 pm
by devinder
What I meant to say was renaming DLL to DMX in no way should effect the loading of Macro into DataCAD's memory using Toolbox Open Dialog.

I compiled the macro and was able to load the dmx with no problems. What is the version no of DataCAD you are testing with? You can also send your compiled macro to techsupport@datacad.com for us to test.

PostPosted: Mon Feb 20, 2006 10:54 am
by devinder
Open your test drive installation folder and rename the Dcaddemo.exe to Dcadwin.exe. All dmx macros that gets compiled look for Dcadwin.exe and not for Dcaddemo.exe or DcadLT.exe.
When you have renamed the executable, your DataCAD Demo shortcut might not work and needs to be updated for the new executable name as well.
Sorry for this inconvenience.

Dcal For Delphi

PostPosted: Tue Feb 21, 2006 5:29 am
by rod_walker
This discussion shows the absolute need for some basic reliable documentation on Dcal for Delphi. This lack of documentation is probably why we are all still using the old 'DOS' Dcal.(':cry:')

Re: Dcal For Delphi

PostPosted: Tue Feb 28, 2006 1:01 pm
by Miguel Palaoro
rod_walker wrote:This discussion shows the absolute need for some basic reliable documentation on Dcal for Delphi.

Good catch Rod.
I'd dare to suggest Dave to build from tip to toe a DCAL for Delphi Development Kit, even before having DataCAD 12 released.
Since we got DC XI able to handle this new engine, it would be a lot of help to invite some developers to work into the enhancements for DataCAD close future.

Thanks,
Miguel

PostPosted: Wed Mar 01, 2006 11:51 am
by devinder
If you want to debug the code, you will need to have the complete developement set up on your Delphi machine as well because you cannot select the DLL from the Toolbox Open Dialog without running DataCAD. Once you have DataCAD setup complete, set the Run-Parameters for Dcadwin.exe with complete path, Eg :"C:\Program Files\DataCAD\Dcadwin.exe". This Exe is not a Debug Executable and you do not need one, as you are debugging your DLL code and not the Dcadwin.exe. This executable will run as a release version with your DLL as a debug code.

From my previous post:
1. the DMX has to be in the same directory as its DPR file (in other words: don't have a define anything in output directory under Project-Options)
2. your project (.DPR) path should not contain directories with a space in the name. There seems to be a problem with debugging DLLs with spaces in the project path under Delphi. Eg "C:\Program Files\DataCAD\DCAL\Samples\Arrow\Arrow.dpr" will not work for Debugging as it contain spaces in folder names. "C:\DCAL\Samples\Arrow\Arrow.dpr" will work for debug.

Set a Break point at following line by placing the cursor and hitting F5 key.
"case dcalstate of" in "Main" function
A breakpoint that is set is denoted by a red line marker. Pressing F5 again will remove the breakpoint and clear the red line marker.

Press the "Run" menu-item in Delphi and this will launch DataCAD. Open/Create a file. Click on Toolbox. Browse to "C:\DCAL\Samples\Arrow" and select "Arrow.dmx" and hit Open in the Dialog box. The program will stop and from this point forward you can debug line by line using F7 key.
When the debug line reaches the last line of "Main" i.e "end;" press F9 to put control back to DataCAD when requiring any kind of input or dcalstate change is required. You will gain control at breakpoint again when a click or key press has been made.

Hope this helps.

PostPosted: Fri Mar 03, 2006 9:23 am
by devinder
The macro you write is an add-on. For an add-on to execute, a base application should be installed that is responsible to load/execute those add-on products and without the base application, the add-on cannot run on its own. Dcadwin.exe is the base application in this case and also the main executable of DataCAD which later loads your macro and executes it. It is within Dcadwin.exe that looks for "Main" function inside your macro and decide how/when to call. The base application exposes some of the functionality that is available to add-on products. These functions/procedures are defined in UInterfaces.pas. Calls to these functions request Dcadwin.exe to get/set the data in the AEC file.


If you have set Run-parameters in Delphi as
\\MyNetworkMachine\SharedFolder\DataCAD\Dcadwin.exe
then yes you can have set up of DataCAD and DCAL on different machines. All I wanted to mention was simply one cannot have DCAL installed and expect to debug the code.