Chapter 2: .NET and DLL Topics
Much like the Framework wraps the GDI+ DLL, ProEssentials provides a managed interface to our low-level charting DLL.
The WinForm, WPF, and WebForm interfaces are mostly hand-shaking interfaces, and the DLL is still required and supplies the core charting functionality. See Deployment for more info.
Within the demo, see example 018 or 123, there are many more that use this feature.
This VB.NET example code shows how to replace the slower PeData.Y property array interface with the fast PEvset DLL call.
** Make Random Data for Graph Object **
Pego1.PeData.Subsets = 4
Pego1.PeData.Points = 12
'** Pass data via dynamically allocated one dimensional array **
'** This logic stores all of the first subset's data and
'** then the second subsets's data and so on into the TmpData array.
ReDim TmpData(Pego1.PeData.Subsets * Pego1.PeData.Points) As Single 'Note Single
For s = 0 To 3 4 subsets
For p = 0 To 11 12 points
Offset = (s * Pego1.PeData.Points) + p
TmpData(Offset) = (p + 1) * 5 + Rnd(25)
Gigasoft.ProEssentials.Api.PEvsetW(Pego1.PeSpecial.HObject, Gigasoft.ProEssentials.DllProperties.YData, MyYData, 48)
Again refer to PEDemo.exe and examples 018 and 102 for more information of using PEvset.
All the ProEssentials visual interfaces contain a property named hObject. This property represents the handle of the ProEssentials object being managed by the visual interface. The developer can use this handle to refer directly to the ProEssentials control, thus bypassing the visual interface. If you look at the PEcreate function, you will see this function returns a handle to an object. The WPF/WinForm/WebForm interfaces call PEcreate for you and store the resulting handle in the hObject property.