Ftp web hosting - Appendix H COM Integration 1367 Fig. H.4 ActiveX
Sunday, December 2nd, 2007Appendix 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.