Marvin OLE User's Guide

Contents

 

Introduction

Marvin OLE is the ChemAxon solution for Microsoft's Object Linking and Embedding (OLE) technology. It is supported by Windows operating systems. Marvin OLE offers an easy way to embed Marvin Sketch drawings into other applications, like Microsoft Office Family products. Embedded Marvin Documents can be edited in-place with a fully functional Marvin Sketch.

Word Documents, Excel Sheets, and many other files containing embedded Marvin Documents are easily distributable. Even people who do not have Marvin and JChem_NET_API installed can access the content as an image, however, to edit the Marvin Document itself, they must have a properly installed Marvin with OLE support.

 

Install and Uninstall

Installation

The OLE server is bundled in JChem_NET_API installer, when JChem_NET_API is installed it automatically register OLE server too. Administrator privileges are required for the installation since the installer writes the Windows registry. OLE server does not require present of Marvin Beans package. If it is not available it uses the .NET version of MarvinSketch (that is also part of the JChem_NET_API as the OLE server OLE server). If Marvin Beans package has been installed, OLE server prefers the Java based Marvin by editing OLE objects.

When you install Java based Marvin Beans package, the installer strores a reference in the Windows registry about the location of the MarvinSketch application. OLE server check this reference when try to look-up it.

The Marvin Beans installer also includes the JChem_NET_API.msi file and launch it automatically during the installation process. It means that you do not have to download or register any extra resources to setup OLE server since installer does it automatically.

If you do not use Marvin Beans installer but you need both Marvin and OLE server, you have to do the followings:

If installation has been successful, you will find OLE Server resource in the C:\Program Files\ChemAxon\Shared\MarvinOLE folder.

Uninstallation

When you uninstall JChem_NET_API, OLE server is also unregistered and the C:\Program Files\ChemAxon\Shared folder is also deleted (where OLE server resources was stored).

In this case, Marvin OLE support will not be available for Marvin.

When you uninstall Marvin Beans package, JChem_NET_API uninstaller is also invoked unless other products still keep reference to it.

Of course, uninstallation also requests administration privileges.

Administrator privileges

Windows 2000/XP: Most users have got administrator privileges in default (unless the system administrator restricts it). If you have got full control on your machine (install anything freely), you have administrator rights. In this case, installer/uninstaller will run definitely with admin privileges.

Windows Vista: Vista security policy is more strict than earlier Windows versions. If a user has got administrator rights, it does not mean that he can run everything with these privileges. In default, all programs run without extra rights. To run a program with administrator privileges, you have to select Run As Administrator by launching (right-click on the icon of the application and choose Run As Administrator option). After selecting this option, Vista will ask for confirmation to run the application with high privileges, click Allow. The application will run in admin mode.

Although ChemAxon installer/uninstaller does not require admin rights, it detects the highest running level and tries to run in administrator mode automatically (if it is possible). If the installer has got the proper rights, it does registration/unregistration of OLE server in the background during the (un)installation process.

 

How to Use

Simply select your drawing, or any part of it and copy it to clipboard (Ctrl+c). The selection can be pasted into any OLE-capable application, like Microsoft Office Family (if OLE support is enabled).

This feature also works in a reversed way: select an embedded Marvin OLE document from your Excel Sheet or Word Document, copy to the clipboard (Ctrl+c), then use the paste function (Ctrl+v) at your MarvinSketch to retrieve the structure.

IF OLE copy does not work for you, please check the followings:

 

Customize Marvin OLE editing mode

When you would like to edit a Marvin OLE object in an MS-Office document, MarvinSketch can be opened by a couple of ways depending on the configuration of the OLE server.

By default, when OLE object is edited the editor opens embedded into the MS-Office application. If you would like to see MarvinSketch in a standalone window during editing the OLE object, you have to modify OLE server settings in the registry.

In the C:\Program Files\ChemAxon\Shared\Marvin OLE folder, you will find various registry files that can help you to modify registry:

Just install the desired regfile to modify the edit settings of the OLE server, as follows:

Installation of a regfile

Logging

Basically there are five components relating to Marvin OLE which the user can expect log files generated from.
  • Marvin OLE: This logging folder represents all logging information written out from the embedded OLE sketch.

  • CXNEmfExporter: This logging folder contains log files by EMF picture generator, EMFExporter component is responsible for antialiased picture rendering.

  • CXNdotNetClassCOMLoader: This logging folder contains log files if .NET components are about to be loaded, typical case when .NET version of Marvin OLE is running.

  • CXNMarvinOLEWrapper: OLE Wrapper component is typically used in browser based ChemAxon solutions e.g. SharePoint data editing.

  • CXNOLEClient: OLE Client component is used in thick client applciations for Marvin OLE conversions, e.g. JChem for Excel.

  • Component specific folders can be found in the ChemAxon root folder under the following locations: If the users turn to support help, these folders need to be zipped and sent to the relevant support team/department. Please take care of that log files might contain confidential local information (molecules) therefore log files are better to be sent directly to the support teams. Forum posts are public and searchable for other users therefore should be avoided for any log file uploading. Support teams handle the logging information confidentially.

    How to set logging

    In Marvin OLE (but also true for other components listed above) the verbose and style of the logging can be set in the following location of the registry: HKEY_CURRENT_USER\Software\ChemAxon\MarvinOLE. Under the Verbose registry key there are five options to be set:
  • DateFormat: The default time format of the logging is %H:%M:%S. Log files are separated by dates so the relevant date information can be seen in the name of the log file as default. User can freely customize it to include full date time if necessary. Microsoft DateTime formatting guidelines

  • FileExtension: This setting contains the file extension of the log file.

  • FileName: The name of the log file can also be changed, but it should keep the rules of file name generation under Windows.

  • Level: This is the most important setting for both the users and the adminsitrators. It allows to change the verbose level, i.e. how much information the log file needs to contain.

  • MessageFormat: The default format is {%s [%d]%s %s - %s} e.g.: 23:59:21 [3]INFO MarvinOLE - C:\PROGRA~1\ChemAxon\Shared\MARVIN~1\MARVIN~1.EXE Microsoft message formatting guidelines

  • Event logging

    All CXN components, like Marvin OLE, also place error level log information in the System Event Log (in addition to the log file). Microsoft Event Log Guide Event Viewer shows all types of logs, ChemAxon generally reports problems under the Application section.
     

    Troubleshooting and Administration

    Marvin OLE does not start or stopping with failure

    If the component cannot be launched by inserting into Office applications or the object cannot be copied onto the clipboard from Marvin Beans or from Marvin Editor component, then it hints an installation/uninstallation problem or a mismatch in the running mode. The first thing we recommend to check is the RunningMode flag in the registry. HKEY_LOCAL_MACHINE\SOFTWARE\ChemAxon\MarvinOLE
  • This registry key is accessible only for administrators.
  • HKEY_LOCAL_MACHINE\SOFTWARE\ChemAxon\MarvinOLE\Settings\RunningMode is decimal value numbering from 1. If RunningMode is set to Java (1), Marvin OLE will search for the Java infrastructure, the Marvin Beans. To be able to find it, the following registry path should contain the referenced Marvin Beans isntallation folder and its version:
  • HKEY_LOCAL_MACHINE\SOFTWARE\ChemAxon\MarvinOLE\ReferenceFolders
  • e.g. C:/Program Files/ChemAxon/MarvinBeans/lib 5.4.0.0
  • If it is not there, Marvin OLE cannot be launched in Java mode.
  • In this case the administrator should either make correction in the referential folder by adding the correct path with '/' slash, or should delete the whole ReferenceFolders regsitry key, and delete(change) the RunningMode key to .NET (2).
  • This is the common problem, which might occur especially with early version of installers like 5.3.x series.
  • If Sun Java environment damaged or no jvm installed locally providing jni bridge it is recommended for the adminsitrator to change the registry accordingly to .NET version or to repair the Java environment.

    Marvin OLE works without problem but does not display the molecule after editing

  • In this case either the user should find a JNI invocation error in the Marvin OLE log, and check running mode (see above) or the EMF generator component has a problem and then its log file contains hints of the origin of the problem.
  • The whole Marvin OLE needs to be reinstalled.
  • This case generally could happen when the user wants to install two different ChemAxon products with two different major versions. e.g. IJC 5.3.x and Marvin Beans or JChem for Excel 5.4.x.

    Marvin OLE editor is displayed not in the desired editing mode

     

    Known Issues

    Word Pad pops up a dialog indicating that Marvin OLE Server is not responding while inserting a new Marvin Document, or editing an exisiting one with MarvinSketch. This causes no harm or data loss, it is an invalid error message fired by Word Pad. After you complete the drawing process, and close MarvinSketch, press 'Retry' to close the dialog.

    Open Office: Although Open Office is not supported, this OLE solution works partially on that platform. The following issues are known: copy from Open Office into Marvin does not work; the image of the embedded structure is not refreshed after editing without saving the whole office document.

     
    Copyright © 1999-2011 ChemAxon Ltd.    All rights reserved.