TurboCAD Forums

The Ultimate Resource for TurboCAD Knowledge

Register
 
The purpose of these forums is to discuss TurboCAD.  Please keep the discussion of other products to compatibility issues or how the other software’s can be used with TurboCAD.


A basic "Delphi XE2 Starter" example req'd
Read 3146 times
* April 03, 2012, 03:34:38 PM
After many years of not doing very much programming, I have invested in the Delphi XE2 Starter edition, and am keen to see a few basic examples of it's application with the Turbocad  V18 SDK. I have tried a couple of the old examples, however there seems to be a change in Delphi code in relation to the emptyparam value in the IMSIGX_TLB with the latest versions of Delphi.

Any assistance , even with a basic example would be appreciated.

Mike Geraghty.

Logged


* April 10, 2012, 09:05:17 AM
#1
Hi Mike,

I haven't dipped my toes into Delphi for a few months. Where are you having problems? Code snippet of the offending line(s) would be helpful, as would the contents of your "uses" clauses.

Kevan

Logged


* April 13, 2012, 01:26:46 PM
#2
Hello Kevan, I tried some of the old examples out, and found out that I had to change the emptyparam olevariant value's to a variable in the IMSIGX_TLB file, but since then have tried the latest examples in the Turbocad V18 SDK examples folder, and found that the IMSIGX_TLB in that folder has been updated to a version that does not use emptyparam.

I managed to get some of the examples working, so in the next week or so will delve further. The Delphi XE2 starter is quite a good buy, plus as a bonus, I received C++ starter free. Lots to brush up on after about 6 years since last I used it, but I now have some database functionality with interbase , plus being able to create active X and custom components.

One off hand question which is a separate matter, do you know if it is possible for a plugin or addon/tool to start when the program is first run?. Reason for the question, if a routine loaded at start of a drawing, then it would be possible to put a date or time stamp in the file automatically,  along with setting drawing parameters and a number of other routines that would be handy to start automatically on load.

I am going green at present, setting up a veggie patch in the garden, but in the next week or so will be eager to see what I can do with my new software.



Regards
              Mike Geraghty.

Logged


* May 08, 2012, 07:56:47 AM
#3
Delphi (and most other programming languages for that matter) doesn't allow "optional" arguments to be omitted, and requires that you have something for every argument to a function. EmptyParam is just the Delphi version of a "throwaway" OLE Variant variable that you can use for optional arguments.

I am attaching a Delphi XE2 version of the old Flange application that you and I began with -- hopefully the examples there will help you on your way. Note that for some reason this doesn't work properly (at least on my system) if RedSDK is enabled -- you'll need to switch to GDI in the Native Draw options.

Regards,

Kevan

Logged


* May 10, 2012, 08:07:35 AM
#4
Delphi (and most other programming languages for that matter) doesn't allow "optional" arguments to be omitted, and requires that you have something for every argument to a function. EmptyParam is just the Delphi version of a "throwaway" OLE Variant variable that you can use for optional arguments.

I am attaching a Delphi XE2 version of the old Flange application that you and I began with -- hopefully the examples there will help you on your way. Note that for some reason this doesn't work properly (at least on my system) if RedSDK is enabled -- you'll need to switch to GDI in the Native Draw options.

Regards,

Kevan

Only just spotted this posting Kevan, and have given it a try out, it works just perfect. What I can do now is work on the routine to load the flange tables.

Many thanks for your example, it is invaluable.

Regards Mike Geraghty.

Logged