Esker ActiveX Plug-in Reference Name of the Esker ActiveX Plug-in file: NPESKP32.DLL Installing the Esker ActiveX Plug-in: Just copy the file NPESKP32.DLL to the PLUGINS subdirectory of the Netscape installation directory (the directory containing the NETSCAPE.EXE file). Alternatively, you can use Netscape SmartUpdate technology to install the Esker ActiveX Plug-in. For this, you will need to place the NPESKP32.JAR file (containing the NPESKP32.DLL file) on the HTTP server as well as some JavaScript code. In the source of this document, there is an example of JavaScript code you can use (see functions installPlugin and reloadPlugins). Declaring an Active-X component in a HTML page for Netscape: This corresponds exactly to the following OBJECT tag for Microsoft Internet Explorer: Making compatible HTML pages for Netscape and Microsoft Internet Explorer: This declaration uses a JavaScript object called "ActiveX" defined like this: General Differences between IE & NetScape: Beside the usual differences between IE and Netscape (case sensitivity...) there are some specific differences for ActiveX controls: 5a) The "onLoad" event of the HTML body object is fired by Netscape before the ActiveX controls are actually activated. A good way to use the "onLoad" event is as follow: 5b) The "onUnload" event of the HTML body object is fired by Netscape after the plug-ins are unloaded. That means that the "onUnload" event handler cannot call ActiveX control methods. 5c) Javascript callback limitation: an ActiveX control may be passed a javascript object and may call methods of this javascript object. The javascript callback code must not in turn call directly ActiveX methods nor the javascript "window.alert" method. Instead this call must be done asynchronously using "setTimout": if (error) { setTimeout ('alert ("an error has occured!")', 0); } else { setTimeout ('NfsdlgX.DoIt()', 0); } The same limitation applies in javascript event handlers. Note: "setTimeout" inside a "setTimeout" does not always work in Netscape. 5d) Because Esker ActiveX Plug-in uses Netscape LiveConnect technology, arguments passed to javascript callbacks are in fact java objects. As java objects are compared by reference and not by values, it is sometimes necessary to change these arguments to actual javascript objects using the following technique: var string1 = "" + arg1; // a string argument var boolean2 = ("true" == "" + arg2); // a boolean argument var number3 = 0 + arg3; // a numeric argument 5e) The Esker ActiveX lug-in needs the ActiveX type info. ActiveX controls developed with Microsoft MFC expose a ITypeInfo interface automatically but some sub-objects (derived from the CCmdTarget class) may not expose theirs. To call methods on these sub-objects from javascript, it is required that the ITypeInfo interface be exposed explicitly. To do this, the following code must be added to the ActiveX class declaration: DECLARE_OLETYPELIB (CSubObject) virtual BOOL GetDispatchIID (IID* pIID); And to the ActiveX class definition: IMPLEMENT_OLETYPELIB (CSubObject, _tlid, _wVerMajor, _wVerMinor) CSubObject::CSubObject() { AfxOleLockApp (); EnableAutomation(); EnableTypeLib (); } CSubObject::~CSubObject() { AfxOleUnlockApp (); } BOOL CCrypt::GetDispatchIID (IID* pIID) { *pIID = IID_ISubObject; return TRUE; } 5f) ActiveX controls loaded in Netscape by Esker ActiveX Plug-in must be declared safe for scripting (and safe for initializing if they expose the IPropertyBag interface). There are no settings to ask a confirmation to the user to override this behaviour. 5g) Security issue. The Esker ActiveX Plug-in is basically designed for intranet/extranet application only, not for internet. ActiveX placed on a server outside the intranet are not downloaded because they are not considered as trusted. There is no confirmation asked to the user. Extranet applications are addressed by declaring the HTTP server as part of the domain of the extranet user in is DNS. Alternatively, each individual extranet user may add the name of the the HTTP server in the DEPLOYER.INI file under the Windows directory: [TrustedServers] www.ourcompany.com=yes Note: using HTTPS allows the download of any ActiveX from any server owning a valid certificate. 5h) The Esker ActiveX Plug-in does not implement the CAB format. To download complex ActiveX components that depend on other components you must either declare these components in the HTML page or use a DPL file. The DPL format is the format used in the Esker PLUS product line.