Marvin OLE User's Guide
Contents
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.
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 the presence 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.
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:
- Make sure JChem_NET_API is installed on your machine. (If you
open Add/Remove Programs section in Control Panel, you can check easily whether the required component is in the list.
- Open the
C:\Program Files\ChemAxon\Shared\MarvinOLE
folder to check whether MarvinOLEserver.exe
is there.
- Check whether the OLE copy option is enabled in the Copy As dialog in the Edit menu of Marvin. If not, OLE server is not registered.
Uninstalling and reinstalling JChem_NET_API can help in this case.
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\MarvinOLE
folder, you will find different registry entries that can help you to modify the registry:
- StandaloneModeForAdministrators.reg: this registry file is defined for administrators to
deploy Stand Alone Mode data editing company wide as default for all users. This setting cannot be applied by
restricted users since it is targeting to change a global part of the registry database.
This global setting can be overriden by each user individually with running the StandaloneModeOn or
StandaloneModeOff files (see below).
- StandaloneModeOn.reg: this registry file is for restricted users to influence the global setting
of default editing mode. This script switches the default editing mode to Stand Alone Mode.
The in-place mode is optionally still available in every Office application by selecting the
Edit menu point from the context menu on a MarvinOLE document.
- StandaloneModeOff.reg: this registry file is to reset the default approach of data editing
(as is after installation) when in-place mode is the default data editing mode in the container applications.
Just install the desired regfile to modify the edit settings of the OLE server as described below.
- Navigate into the directory in file Explorer where the desired regfile is located and take a right mouse-click on
the file.
- Select Open With... option from the popup menu. If regedit.exe is available in the list, select it.
If not, commit the Browse button in the Open With dialog and find regedit.exe to select it.
By default, it is located in the
C:\Windows
folder.
- After selecting regedit.exe, submit the Open With dialog to run desired regfile with regedit.exe.
UI settings for Standalone mode
Marvin OLE represents a multi-document interface, which means that the users can edit more than one single document at a time.
When using standalone mode all opened documents can be seen in child windows hosted in a main window frame.
From version 5.12 a new setting is avilable for both administrators an users: for setting that these OLE documents should be opened in maximized window state.
(Maximized window state is when the active document window overlaps, covers all other document windows.)
Alt+Tab helps switching among all opened documents as normally, but the active document child gets into focus with full size in the host.
Registry key for this feature is
[Maximized = DWORD value]
where 0x1 value means True (display in maximized way) and 0x0 value is the default False (display in normal way)
- For administrators we have a key to set and change this setting by
HKEY_LOCAL_MACHINE\SOFTWARE\ChemAxon\MarvinOLE\Settings
- For the current user this setting is
HKEY_CURRENT_USER\Software\ChemAxon\MarvinOLE\Settings
which overrides the administrator value.
Redirecting other Vendors' OLE objects to Marvin OLE
From version 5.7 Marvin OLE started supporting conversion of other Vendors' embedded OLE objects to Marvin OLE.
This means an in-place migration of OLE contents generated by other chemical OLE objects.
The list of currently supported OLE:
- ISISDraw, SymyxDraw, AccelrysDraw OLE content -
(MDLDrawOLE.MDLDrawObject)
- ChemDraw OLE content -
(ChemDraw.Document)
Installation of this capability requires administrator skills and privileges strictly.
In the C:\Program Files\ChemAxon\Shared\MarvinOLE
folder, you will find the relevant registry file (Install_ISIS_Symyx_OLE_Redirection.reg or Install_ChemDraw_OLE_Redirection.reg) which helps you to modify the registry accordingly.
The administrator should do the following steps to get this feature installed properly:
- BEFORE the OLE redirection, the following registry keys should be exported (and saved) for backup purposes.
On a 32-bit system:
- for MDLDrawOLE objects: HKEY_CLASSES_ROOT\CLSID\{0004AFF7-0000-0000-C000-000000000046}
- for ChemDraw documents: HKEY_CLASSES_ROOT\CLSID\{41BA6D21-A02E-11CE-8FD9-0020AFD1F20C}
On a 64bit system: the above and
- for MDLDrawOLE objects: HKEY_CLASSES_ROOT\Wow6432Node
- for ChemDraw documents: HKEY_CLASSES_ROOT\Wow6432Node
- When the above entries are saved, the "Install_ISIS_Symyx_OLE_Redirection.reg" or the "Install_ChemDraw_OLE_Redirection.reg" regfile can be executed. (See it in the previous section)
- AFTER the OLE redirection, to restore the original state of the system (i.e. without OLE redirection), the above keys should be deleted from the registry, and the exported keys should be imported again.
If the installation of this feature was successful the third-party OLE content will be converted during the OLE editing process.
Important!
After executing the
Install_ISIS_Symyx_OLE_Redirection.reg , or the
Install_ChemDraw_OLE_Redirection.reg file
your OLE object will be opened by Marvin in the future.
In each case when a user is about to open the third-party OLE content, an automatic confirmation dialog will be dropped to get this conversion confirmed. (If a structure is selected and copied in SymyxDraw, when it is pasted to an MS Office document, the confirmation dialog appears, too.)
On the dialog, the user should allow (or disallow) the redirection operation and also can apply his decision for all similar cases (check box): how should the same OLE type be edited in the future. If the checkbox was selected, the confirmation dialog will not be dropped for that OLE content type any more.
The decision is stored for each OLE content type in the following registry path: HKEY_CURRENT_USER\Software\ChemAxon\MarvinOLE\Settings
If the appropriate registry key (e.g. the \SKCConversion) is deleted, the confirmation dialog will appear next time again at editing the third-party OLE.
Redirect file associations to MarvinView
File associations can be modified according to the standard Windows procedure, as described above in the Installation of a regfile paragraph.
But there is another way to redirect the .SKC file associations (from IsisDraw or SymyxDraw) or the .CDX file associations (from ChemDraw) to MarvinView: on installing (or reinstalling) MarvinBeans, the 'Allow file associations' checkbox should be checked, and on the next, 'Select File Associations' popup the 'Isis/Draw molecule file (*.skc)' or/and the 'ChemDraw chemical structure exchange file (*.cdx)' checkbox should be checked.
This file association-redirection can be reverted when MarvinBeans is reninstalled again, and the 'Isis/Draw molecule file (*.skc)' or/and the 'ChemDraw chemical structure exchange file (*.cdx)' checkbox remains unchecked (default) - or when MarvinBeans is uninstalled.
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:
- Windows XP:
C:\Documents and Settings\{CURRENT USER}\Application Data\ChemAxon
- Windows Vista or above:
C:\Users\{CURRENT USER}\AppData\Roaming\ChemAxon
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.
- FATAL (0): Reports only fatal errors. We do not use this and it is not recommended. All error level problems should be logged.
- ERROR (1 Default): Recommended setting for error reporting.
- WARNING (2): Reports the more problematical things, which are not error but relevant for support.
- INFO (3): Lighter infromation, which can be very useful in the case of support.
- DEBUG (4): Development level information, e.g. Variable contents.
- ALL (5): All logging.
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
- %s : the formatted date/time stamp value indicating the moment when the log information arrives in the logger component.
- [%d] : level of the current logging
- %s : name of the current logging level
- %s - %s : application domain name - and the message itself
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.
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.
- RunningMode key is deleted! - Marvin OLE will be running in .NET mode by default.
- Java Mode (1) - Marvin OLE is running in Java mode.
- .NET mode (2) - Marvin OLE is running in .NET mode even if Java mode was installed.
- Data transfer mode (3) - Marvin OLE is running without GUI. (Not recommended)
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:
KEY_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
- For simple troubleshooting please run the StandaloneModeOff.reg/StandaloneModeOn.reg accordingly.
- If the desired mode is standalone editing mode (Marvin OLE is displayed in a separate window end it even runs in-placed) then
it is worth running StandaloneModeOff.reg first and StandaloneModeOn.reg afterwards again to clear up the registry.
- Adminsitrator wants to set the Standalone Mode globally for all users but on some users machines it is still in in-palce editing mode. In this case it is worth checking if the user has overriden any global settings by a local one here:
HKEY_CURRENT_USER\Software\ChemAxon\MarvinOLE\Settings\StandaloneMode.
If this key contains 0 value, it means that the user has choosen the in-palce mode explicitly.
The key either should be deleted or needs to be set to 1 for eliminating the problem.
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-2014
ChemAxon Ltd.
All rights reserved.