Article | 60000198 |
Type | HowTo |
Product | Engine |
Version | 6 |
Date Added | 7/5/2007 12:00:00 AM |
Fixed | (7/5/2007 12:00:00 AM) |
Submitted by | Peter Chanios |
Summary
The wrapper component is a COM ActiveX that can be used in environments like vd6 and c++6. We have implements .tlb files which can be added in the project's references and can give your application functionalities of the new component. For more information and implementations you can contact us for more details. Exported tlb files : VectorDraw.Serialize.tlbVectorDraw.Render.tlbVectorDraw.Professional.tlbVectorDraw.Geometry.tlbVectorDraw.Actions.tlbVdrawPro5.tlbvdrawi5.tlbvdPropertyGrid.tlbVdProControl.tlb
Solution
The following code samples implement the wrapper component where with the use of a button we add a vdMtext object which is a completely new object that is implemented in our new libraries and was not present in version 5. For this implementation we have imported VectorDraw.Geometry.tlb ,VectorDraw.Professional.tlb and also vdrawi5.tlb
VB6 code sample: | C++ code sample: | |
Private Sub Command1_Click() Dim baseobj As VectorDraw_Professional.vdBaseObject Set baseobj = mtext baseobj.SetUnRegisterDocument doc 'typecast the Mtext as vdPrimary Dim pt As VectorDraw_Geometry.gPoint Set pt = New VectorDraw_Geometry.gPoint pt.SetValue 2, 3, 0 'set values in some properties of mtext Dim fig As VectorDraw_Professional.vdFigure Set fig = mtext 'add mtext in the collection entities table fig.Invalidate VDraw1.CommandAction.Zoom "e", 0, 0 |
void
Cvd6WrapperDlg::OnBnClickedMtext() //Create a new Mtext object with VectorDraw FrameWork Interfaces //typecast the Mtext as vdbaseObject //typecast the Mtext as vdPrimary //Create a gPoint object; //set values in some properties of mtext //typecast the Mtext as vdFigure //add mtext in the collection entities table |
|
|
||
Delphi 7 code sample: | ||
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, SHDocVw, AxCtrls, OleCtrls, VDrawLib5_TLB, VDrawI5_TLB, VectorDraw_Professional_TLB, VectorDraw_Geometry_TLB; procedure TForm1.Button1Click(Sender: TObject); var mtext : VectorDraw_Professional_TLB.IvdMText; pt : VectorDraw_Geometry_TLB.Igpoint; doc : VectorDraw_Professional_TLB.IvdDocument; primary : VectorDraw_Professional_TLB.IvdPrimary; baseobject : VectorDraw_Professional_TLB.IvdBaseObject; begin vdrawpro.DisableMouseStockEvents := True; // See article 60000734 doc := vdrawpro.ActiveDocument.WrapperObject as VectorDraw_Professional_TLB.IvdDocument; pt := VectorDraw_Geometry_TLB.CogPoint.Create(); pt.SetValue(2,3,0); mtext := VectorDraw_Professional_TLB.CovdMText.Create(); baseobject := mtext as VectorDraw_Professional_TLB.IvdBaseObject; baseobject.SetUnRegisterDocument(doc); primary:=mtext as VectorDraw_Professional_TLB.IvdPrimary; primary.setDocumentDefaults(); mtext.TextString := 'VectorDraw Mtext using VDF Interfaces'; mtext.InsertionPoint := pt; mtext.BoxWidth := 12; mtext.Height := 1; doc.ActiveLayOut.entities.AddItem(mtext as VectorDraw_Professional_TLB.IvdFigure); vdrawpro.CommandAction.Zoom('E',0,0); end; procedure TForm1.Button2Click(Sender: TObject); |