Technical Support Forum Index
Technical Support Forum
Access ChemAxon scientists and developers here. For registration and login issues contact website support.

Support Ticket System is replacing forum

This forum was converted into a searchable archive. You cannot add posts here any more. For support please use our new Ticket System.

Create your first ticket
Mview OLE connection under WIN
To watch this topic for replies  Register (enables digests) or give email address:
This topic is locked: you cannot edit posts or make replies.
Display posts from previous:   
    View previous topic :: View next topic    
Author Message
Tobias

Joined: 26 Jan 2005
Posts: 580

View user's profile

Back to top
Link to postPosted: Wed Jun 03, 2009 1:18 amPost subject: Mview OLE connection under WIN Reply with quote

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

 

Tamas
ChemAxon personnel
Joined: 21 May 2004
Posts: 2171

View user's profile

Back to top
Link to postPosted: Fri Jun 05, 2009 7:07 pmPost subject: Reply with quote

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.

Tobias

Joined: 26 Jan 2005
Posts: 580

View user's profile

Back to top
Link to postPosted: Fri Jun 05, 2009 8:11 pmPost subject: Reply with quote

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

 

Tobias

Joined: 26 Jan 2005
Posts: 580

View user's profile

Back to top
Link to postPosted: Fri Jun 05, 2009 9:19 pmPost subject: Reply with quote

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

 

 

Tamas
ChemAxon personnel
Joined: 21 May 2004
Posts: 2171

View user's profile

Back to top
Link to postPosted: Wed Jun 10, 2009 4:33 pmPost subject: Reply with quote

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.

Tamas
ChemAxon personnel
Joined: 21 May 2004
Posts: 2171

View user's profile

Back to top
Link to postPosted: Wed Jun 10, 2009 6:15 pmPost subject: Reply with quote

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.

This topic is locked: you cannot edit posts or make replies.
Page 1 of 1


To watch this topic for replies   Register (enables digests) or give email address  
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum