![]() |
||
InstallationTo install DXFReader run DXFReaderSetup.exe on the CD-ROM or on the folder where you've downloaded and expanded the file DXFREADER.ZIP.
The following files will be installed into your Windows\System32 directory only if their version number is higher:
The following files will be installed into the program directory specified during installation:
Note: To remove DXFReader from your system use Add/Remove Programs from the Windows Control Panel or select Uninstall DXFReader ActiveX Control in the start menu folder. Installing DXFReader in Visual Studio .NET/2005/2008Unlike the Toolbox in Visual Basic 6.0, which retains customizations for a single project, the Visual Studio .NET Toolbox retains customizations for the entire development environment. When you load the DXFReader ActiveX Control in the Toolbox, as described below, it is available in any Windows Form designer, regardless of the language.
Browsing Properties Place DXFReader ActiveX Control on the Windows Form and explore its properties (View»Properties Window). You might notice that several properties have been added or changed, including the default name of the control. Visual Studio .NET prefixes all ActiveX controls with Ax (in Visual Basic .NET) or ax (in Visual C# .NET). For example, when you drop the first instance of a DXFReader on a Visual Basic 6.0 form, Visual Basic 6.0 names that control DXFReader1. When you drop the first instance of a DXFReader ActiveX Control in Visual Studio .NET, Visual Basic .NET names the control AxDXFReader1. Browsing Generated Code Open the code editor, and examine the code that Visual Studio .NET automatically generated. In both Visual Basic .NET and Visual C# .NET, the code generated contains a call to InitializeComponent() to initialize properties on the Windows Form and controls, a call to Dispose() for resource cleanup, and declaration of and reference to the instance of the graph you placed on the form. Changes to the Visual Basic Language
Microsoft made many changes to its Visual Basic language to add object-oriented features and make it more like other .NET languages. This section describes programming changes you will encounter, specifically with respect to default properties and the Item method, as you develop applications with DXFReader ActiveX Control in Visual Basic .NET or Visual C# .NET.
Event Handling Microsoft implemented a new event model in Visual Studio .NET. In this event model, an object generates an event in response to some action or change in state, such as a mouse click or x number of points being acquired. The object that generates the event is called the event sender. Another object, called the event receiver, handles the event and responds by executing an event handler, which processes the event. However, the event sender needs a pointer to the event receiver. The .NET Framework refers to this pointer as a delegate. A delegate is a class that holds a reference to a method. Installing DXFReader in Visual BasicTo install and use DXFReader in Visual Basic there are slight differences between these processes in Visual Basic 5 and Visual Basic 6, but they are largely superficial. The figures that follow show dialogs and screens used to install DXFReader in Visual Basic 5/6.
In Visual Basic 5/6, select the Components command from the Project menu.
It will present the dialog shown in figure below. ![]() If the control does not appear in the list, click the Browse button and locate the DXFReader control's .OCX file. Select the file and click OK. At this point Visual Basic will add entries to your system registry so the control will be listed in the future.
After you have selected the control, it will appear in the toolbox along with Visual Basic's controls as showed in the figure below.
![]() Installing DXFReader in Visual C++Despite its name, MS Visual C++ is not as visually oriented as Visual Basic. A Visual C++ program manages controls by building a class that represents the control. Class methods provide access to the control's properties, events and methods. The all process can be divided into five steps: 1 - Registering DXFReader in the system registry Before Visual C++ can use a custom control, it must be registered in the system registry. If you installed DXFReader using the setup utility, the installation program provides to register it in the right way. DXFReader can also be registered with the RegSvr32.exe application provided with Visual C++. For example, the following code registers DXFReader located in the C:\WINDOWS\SYSTEM directory: regsvr32 c:\windows\system\dxfreader.ocx It is possible to use RegSvr32.exe to remove DXFReader's entries from the system registry with the /u flag, for example: regsvr32 /u c:\windows\system\dxfreader.ocx 2 - Providing support for ActiveX
To create a MS Visual C++ project that support ActiveX controls, select the New command from the File menu. On the resulting dialog's Projects tab, select the MFC AppWizard (exe) option. Fill in the project name and location and click the OK Button. 3 - Creating the Control To insert an instance of DXFReader in the project, select the Resource View tab. Locate the resource that should contain the control and double-click on it to open it. Press the right mouse button over the resource to make the context menu shown in the following figure appear.
Select the Insert ActiveX Control command, and the dialog shown in the following figure will appear.
If DXFReader has been correctly registered by its installation program, or manually with the RegSvr32 application, it should appear in the dialog's list of controls with the name DXFREADERlib.DXFReader. Pick it and click on the OK button. At this point MS Visual C++ will add DXFReader to the project. If you want to add an instance of the DXFPlot control, simply pick DXFREADERlib.DXFPlot. 4 - Creating Event Handlers Once DXFReader is added to the project you can provide support for control's events. Press the right mouse button over the control and select the Events... command from the context menu. The following figure will appear.
Select an event, for example MouseDown and click the Add Handler button. Enter the name you want to give the event handler function in the resulting input box. For example the control's MouseDown event will be handled by a member function named OnMouseDownDxfreader1.
void CDXFReaderTestDlg::OnMouseDownDxfreader1(short FAR* Button, short FAR* Shift, float FAR* x, float FAR* y) 5 - Supporting Control Properties
The simplest way to access DXFReader's properties in code is to package the control in a wrapper class. This class will provide member functions that manipulate the control itself.
Click the OK button to acknowledge the message, and ClassWizard will create the wrapper class.
For each of the classes you want created, select the class and enter a name, header file, and implementation file for that class. When you are finished, click the Ok button and ClassWizard will create the appropriate classes.
ClassWizard will add a new variable to the project to hold the class instance representing DXFReader. The program can use this variable to manipulate the object and thus the control it represents. The following code will set the PlotRotation property of DXFReader to 1 (dr90) and then plot the drawing 90° rotated:
void CDXFReaderTestDlg::OnOk2()
To use the collections of Entities, Layers, etc you have to include the respective objects' header files, auto generated by ClassWizard, in the main dxfreader.cpp file. To use DXFReader in Delphi, select the Import ActiveX Control... from the Component menu. On the resulting dialog select Kadmos DXF Reader and click the Install... button.
The dialog shown in the following figure will appear:
You can select to insert the control into the existing package to into a new package and then click the OK button. Registering DXFReader
Registering DXFReader is a very simple task. After purchasing the registration code invoke the about method clicking on the ellipses near the word "About" in the properties window (see figure below).
![]()
Next click on the Register... button in the About Box. It will show a dialog window for typing in the registration code.
![]()
Alternatively, you can click the Register... button on the control's properties window that appears pressing the right mouse button over the control and selecting the Properties command from the context menu.
![]() All licensed customers receive unlimited technical support, free upgrades within the major version, discounts on upgrades and are entitled to download free code samples and programs from our Registered Users Area. Copyright © 2008 Kadmos.com - All rights reserved. Privacy Policy |