Mview OLE connection under WIN

User 677b9c22ff

03-06-2009 00:18:40

I,


I usually use the independent ZIP install of JChem, and I remember I could opne


SD and SMI files under WINDOWS with the earlier versions.


If I built the connection with "opne with" command under XP


it pops a SCript but does not open any file, even after I reset the connections.


I am not sure if this is due to the tricky batch files.


Is there any install routine I should call? I also can not find marvinOLEServer in the registry.


 


 


' ReadReg.vbs
' VBScript to read the registry.
' author: Tamas Vertse
' version: 05/17/2006
' since: 03/02/2006

Dim wshShell, regPath, value
Dim ArgObj, var1

Set ArgObj = WScript.Arguments
' get first command line parameter
regPath = ArgObj(0)

' regPath = "HKCR\marvinOLEServer.Document\Clsid\"
' regPath = "HKCR\marvinOLEServer.Document\shell\open\command\"

Set wshShell = CreateObject("WScript.Shell")
On Error resume next
value = wshShell.RegRead(regPath)
if err <> 0 Then
Wscript.Echo "Error: " & regPath & " Entry doesn't exists"
WScript.Quit()
End if

' WScript.Echo regPath & "=" & value

Set output = WScript.StdOut
output.Write value
output.Close


Tobias


 

ChemAxon 7c2d26e5cf

05-06-2009 18:07:39

Can you tell how you installed jchem exactly (step by step)?


Which script or batch file have you selected by "Open With" command?


Although there are a couple of windows- and javascript in the bin directory of the JChem package they do not launch any Marvin/JChem application.


The ReadReg.vbs whose source you have attached is used by MarvinSketch and MarvinView to detect whether the OLE server is activated or not.


To register OLE server, launch marvinOLEServer.exe (take a double-click on it). If everything is OK, the following message will display: "The server can only be run from a container application."


It the system refuse the launching of the OLE server, check privileges of marvinOLEServer.exe. If the execution righ missing, complete it.


We recommend to use the Windows installer of JChem. Because this package is designed for desktop usage. The installer registers OLE server automatically and the bundled Marvin Beans installer does the file association between Marvin applications and chemical structure file extensions.

User 677b9c22ff

05-06-2009 19:11:14

Hi Tamas,


well there is no installation in my case, I just download the ZIP file (platform independent)


and put it in a directory and set the classpath and HOME in Windows.


I can call all batch applications from the command line, but I guess If I dont use the Windows installer there will be ne OLE connection possible.


I was able to call marvinOLEServer.exe with the message "The server can only be run from a container application."


 


Under and WIN installation there is a HKLR shell open command, I guess.


In my case, I always could open SDF and SMI files under WIN by double clicking


and I never used the WIN installer, always the platform independent one.


So the Reg32 says:


HKEY_CLASSES_ROOT\smi_auto_file\shell\open\command


"C:\XXX\mview.bat" "%1"


Well I will figure it out.


 


Cheers


Tobias


 

User 677b9c22ff

05-06-2009 20:19:16

Hi Tamas,


thats exactly the reason why I keep older installations of JCHEM,


things work and change and then they dont work anymore.


 


I can start mview using the batch file from the v314


X:\jchem314\bin\mview.bat "z:\ala ala\nci99.smi"


Works like charm and due to the LIB path it will also start the latest Marvin version


 


If I do the same with the current 5.2.2 Windows Batch file it does not work anymore:


X:\jchem\bin\mview.bat "z:\ala ala\nci99.smi"
The syntax of the command is incorrect.


I can start it without quotation marks (which is bad under windows with long filenames and spaces)


X:\jchem\bin\mview.bat "z:\ala ala\nci99.smi"

z:\ala: not found


IF I rename the directory to ala-ala it works:


X:\jchem\bin\mview.bat z:\ala-ala\nci99.smi


Mview starts with the file, but the syntax is incorrect because it has no brackets.


 


The simple OLE connection will always start the following (Sysinternals Processmon):


cmd /c ""X:\jchem\bin\mview.bat"  "z:\ala ala\nci99.smi""


Desired Access:    Generic Read
Disposition:    Open
Options:    Synchronous IO Non-Alert, Non-Directory File
Attributes:    N
ShareMode:    Read, Write
AllocationSize:    n/a
OpenResult:    Opened


And will fail due to the quotation mark handling problem in the latest WIN batch file mview.bat.


 


So there are some changes in the WINDOWS batch files for v 5.2.2 which do not allow batch starts anymore, but it worked in the older versions such as 3.1.4.


 


Cheers


Tobias


 


 

ChemAxon 7c2d26e5cf

10-06-2009 15:33:12

Thanks for the bug report.


Indeed, mview.bat fails with the given parameter.


We will fix it.


I suggest the following workaround, refer to MarvinView like this:


java -classpath "X:\jchem\lib\jchem.jar" chemaxon.marvin.View "z:\ala ala\nci99.smi"


3.1.4 is a very ancient JChem version, there are a lot of things have been changed (in the batch file too) since then.

ChemAxon 7c2d26e5cf

10-06-2009 17:15:27

I have found the source of the error.


By the evaluation of the parameters, the batch file could not handle " (quote) character in a condition.


Please substitute the following part of the mview.bat (line 80-81):


REM check first two characters of the parameter
set pam=%1


to the following code::: Remove quotes
set nqparam=%1
   SET nqparam=###%nqparam%###
   SET nqparam=%nqparam:"###=%
   SET nqparam=%nqparam:###"=%
   SET nqparam=%nqparam:###=%
REM check first two characters of the parameter
set pam=%nqparam%
The new Marvin/JChem will be already released with the updated batch files.