Archive for December, 2007

Ftp web hosting - Appendix H COM Integration 1367 Fig. H.4 ActiveX

Sunday, December 2nd, 2007

Appendix H COM Integration 1367 Fig. H.4 ActiveX COM control integration in C#. (Part 3 of 3.) The constructor calls SetupRGBTitleScrollbar (lines 41 49), which sets the initial property values of Min, Max, LargeChange and SmallChange for each LabelScrollbar control. The Max property of each LabelScrollbaris set to 255, allowing a color range of over 16 million colors. The constructor also sets the PictureBox s initial back color (lines 34 36). Lines 60 66 define the event handler for the LabelScrollbar s change event. When the user changes the value of a LabelScrollbar, the change event fires and the PictureBox s background color changes. H.3 DLL Integration Visual Studio .NET also supports the integration of COM DLLs. This process is similar to the integration of ActiveX components. To demonstrate how Visual Studio .NET integrates a COM DLL, we have included deitelvb6addition.dllon the CD that accompanies this book. This simple library contains function AdditionFunction, which takes two arguments, adds them together and returns the result. The first step in the integration of this COM DLL is to identify the DLL in the Windows Registry with the RegSvr32 utility as follows: regsvr32 deitelvb6addition.dll After registering the library, add a reference to it in a C# program by right-clicking References in the Solution Explorer and selecting Add Reference. In the Add Reference dialog (Fig. H.5), select the COM tab. Then, choose Simple Addition DLL and click OK. A dialog appears, indicating that .NET must generate a primary interop assembly (Fig. H.5). Select Yes when this dialog appears. The primary interop assembly contains information for all methods and classes contained in the COM library. In Windows, all components (both .NET and COM) must be accompanied by identification information. This information contains Globally Unique Identifiers (GUID) for the component and its internal classes, as well as language-independent descriptions of all classes and types that are defined in the component. These language-independent descriptions help to enable component reuse across multiple programming languages. A GUID consists of a long string of numbers that a computer generates on the basis of the computer s current time, hardware and a random number. The GUID algorithm never generates the same identifier twice; thus, GUIDs enable unique component identification across all computers.
Searching for affordable and proven webhost to host and run your servlet applications? Go to Linux Web Hosting services and you will find it.

1366 COM Integration Appendix H 24 public LabelScrollTest() (Web hosting resellers)

Saturday, December 1st, 2007

1366 COM Integration Appendix H 24 public LabelScrollTest() 25 { 26 InitializeComponent(); 27 28 // setup LabelScrollbar properties 29 SetupRGBTitleScrollbar( redScrollBar ); 30 SetupRGBTitleScrollbar( blueScrollBar ); 31 SetupRGBTitleScrollbar( greenScrollBar ); 32 33 // initialize PictureBox back color 34 pbColorBox.BackColor = Color.FromArgb( 35 redScrollBar.Value, greenScrollBar.Value, 36 blueScrollBar.Value ); 37 38 } // end constructor 39 40 // initialize LabelScrollBar properties 41 private void SetupRGBTitleScrollbar( 42 AxLabelScrollbar scrollBar ) 43 { 44 scrollBar.Min = 0; // minimum value 45 scrollBar.Max = 255; // maximum value 46 scrollBar.LargeChange = 10; // large change value 47 scrollBar.SmallChange = 1; // small change value 48 49 } // end method SetupRGBTitleScrollBar 50 51 // Visual Studio .NET generated code 52 53 [STAThread] 54 static void Main() 55 { 56 Application.Run( new LabelScrollTest() ); 57 } 58 59 // handles scrollbar changed event 60 private void scrollbar_Change( object sender, 61 System.EventArgs e ) 62 { 63 pbColorBox.BackColor = Color.FromArgb( 64 redScrollBar.Value, greenScrollBar.Value, 65 blueScrollBar.Value ); 66 } // end method scrollbar_Change 67 } // end class LabelScrollTest 68 } // end namespace FigH_04 Fig. H.4 ActiveX COM control integration in C#. (Part 2 of 3.)
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.

Appendix H COM Integration 1365 LabelScrollBar Control Control

Saturday, December 1st, 2007

Appendix H COM Integration 1365 LabelScrollBar Control Control Properties .NET Properties Fig. H.3 Fig. H.Fig..Fi H3g. H.3H.3IDE s toolbox and LabelScrollbarproperties. Fig. 1 // Fig. H.4: LabelScrollbar.cs 2 // demonstrates ActiveX component usage in .NET. 3 4 using System; 5 using System.Drawing; 6 using System.Collections; 7 using System.ComponentModel; 8 using System.Windows.Forms; 9 using AxDeitel; 10 11 namespace FigH_04 12 { 13 // Demonstrates ActiveX LabelScrollBar control 14 public class LabelScrollTest : System.Windows.Forms.Form 15 { 16 private System.Windows.Forms.PictureBox pbColorBox; 17 private AxDeitel.AxLabelScrollbar redScrollBar; 18 private AxDeitel.AxLabelScrollbar greenScrollBar; 19 private AxDeitel.AxLabelScrollbar blueScrollBar; 20 21 /// Required designer variable. 22 private System.ComponentModel.Container components = null; 23 Fig. H.4 ActiveX COM control integration in C#. (Part 1 of 3.)
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.