HOW TO CREATE AN ACTIVEX COMPONENT

HOW TO CREATE AN ACTIVEX COMPONENT page 1 HOW TO CREATE AN ACTIVEX COMPONENT page 2

You will see how to create and register wrapped beans on your development system, … This document has shown you how to create an OCX file from a Java component that …

More PDF Content

HOW TO CREATE AN ACTIVEX COMPONENT HOW TO CREATE AN ACTIVEX COMPONENT Purpose and ScopeThe purpose of this document is to show you how to create an ActiveX wrapper for the Java Components within the Java SDK. This will allow a Developer to create an application within a C Basicenvironment rather than Java. You will see how to create and register wrapped beans on your development system, and provide guidance for deploying the wrapped beans to your end users. It will not discuss ActiveX or Javabean technologies, and it will not cover the usage of the wrapped Javabeans. Prerequisites It is advised that you have a good understanding of Java and Visual C++ to ensure thefollowing process is carried out correctly.Sun Microsystems Java SDK V1.4.2 or greaterMicrosoft Visual C++ V6 or greaterJava Client SDK V3.0.0 or greater References ActiveX Bridge Developer Guide (http://java.sun.com/j2se/1.4.2/docs/guide/beans/activex/developerguide/index.html) IntroductionThis section will guide you through the process of wrapping a Java component with an ActiveX wrapper using Sun’s ActiveX bridging tools, it will: Explain how to prepare your environment to perform the wrappingTake you through the wrapping step by stepExplain what process must be followed when deploying the wrapped Java component Prepare your environmentIn order for the Sun’s ActiveX packager to work correctly, you must first run the VCVARS32.BAT batch file for your Visual C++ development environment in the command/MS-DOS prompt window that you willbe using to perform the wrapping. The batch file is usually found in the “bin” subdirectory of the Visual C++ installation e.g. C:\Program Files\Microsoft Visual Studio\VC98\Bin Packaging the Java ComponentThe initial process you should carry out is to create a unique class-id for your wrapped bean. Note When wrapping the same bean, always use the same class-id to avoid having conflicting copies of the same component installed simultaneously. To create a class-id that you can use, you need the GUID generator from Visual Studio. This is usually found in the “common\tools” subdirectory e.g. c:\Program Files\Microsoft Visual Studio\Common\Tools\GUIDGEN.exe Launch the GUIDGEN tool and select registry format from the options, Click the “New GUID” button,Locate the directory where the netvu.jar file from the Java SDK is stored.At this stage you need to create a simple batch file that will automatically generate and register the wrapped bean for you. Note You can then use this batch file each time you want to wrap the same Java component and it will automatically use the same class-id. Type; notepad wrap_.bat and press Enter. (Replace with the name of the Java component you want to wrap, i.e. if you were wrapping the Viewer Java component, you would type notepad wrap_Viewer.bat). Once the editor appears you want to add a single line to the text file using the following syntax: c:\\bin\packager -clsid {}-out “\axbridge\bin” – reg For example, if you were wrapping the Viewer Java component, you would enter a command similar to the one below: c:\j2sdk1.4.2\bin\packager -clsid {915ABFB5-D7F3-420e-89CC-2F94EEEF8E9F} -out “c:\Program Files\Java\j2re1.4.2_03\axbridge\bin” -reg netvu.jar uk.org.netvu.awt.Viewer Save this file using File -> Save; then quit the editor using File -> Exit. Note It is advisable to add the call to VCVARS32.BAT before the call to the packager to ensurethat your environment is always correctly configured before wrapping the Java componente.g. call “c:\program files\microsoft visual studio .net 2003\vc7\bin\vcvars32.bat” The next process is to run the batch file that has just been created, type: “wrap_ component>” and the Java component will automatically be wrapped for you and registered on yoursystem using the class-id you generated earlier. If the wrapping process was successful, there will be a DLL file with the same name as the Java component you have wrapped in the \axbridge\bin directory, and the netvu.jar file will be inthe \axbridge\lib directory. Testing your ActiveX componentThe simplest way to test your new ActiveX component is in the ActiveX Control Test Container application that ships with Microsoft Visual Studio. Launch the application, usually found at “C:\Program Files\microsoft visual studio\common\tools\TstCon32.exe” and select Edit->Insert New Control. In the list that appears, look for the name of the Java control that you wrapped with “Bean Control” appended to it e.g. “Viewer Bean Control”. Highlight the ActiveX control that you want to test and click OK. This will place the control in the test container and activate the ActiveX bridge. From here you can manipulate the public interface of the ActiveX control using the Control->Invoke Methods… option from the drop down menus. If you wrapped the Viewer Java component for example, you could invoke the “setHost()” method passing the address of a video server, then invoke the “live” method to start receiving live images fromthat video server. Deploying your ActiveX componentWhen you deploy the wrapped Java component(s), you need to ensure the user is using the Sun Microsystems JRE v1.4.2 or greater During installation you should copy the DLL file to their \axbridge\bin directory (your installation procedure should create this directory if it does not already exist), and register it on theirsystem. Some installation packages will handle this for you, otherwise you will need to callREGSVR

Processing your request, Please wait....

Download PDF eBook

PDF | Source » www.dedicatedmicros.com | 30 pages | 1187.66 KB |

Related Search Term:create waterdrop in coreldraw, create water like effect in coreldraw, create 3d pdf google earth, electrical wire diagram component clip art, ebook how to create a dyanamic page using dreamweaver, ebook on how to create dynamic page using dreamwaever, how to create water drops in illustrator or corel draw, create water in corel draw, how to create templates in dreamweaver MX2004, lightwave "create emitter"

Leave a Reply