zoukankan      html  css  js  c++  java
  • 64位操作系统下调用32位com的问题

    Hello Guys!

    I am trying to create a simple VBS script to automatically open some .tif images from a specified path on a server with Microsoft Office Document Imaging. There is a COM available, but it did not work when I used scripts found on the web:

    Set objShell = WScript.CreateObject("WScript.Shell") ObjShell.exec("C:Program Files (x86)Common Filesmicrosoft sharedMODI12.0MSPVIEW.EXE") Set ObjShell=Nothing CreateObject("Scripting.FileSystemObject") Set MiDoc = CreateObject("MODI.Document")

    miDOC.Create = scanurl  //这个程序员这个地方用的错误

    Set miDoc = Nothing

    When I tried to launch it, an error occured:

    ---------------------------
    Windows Script Host
    ---------------------------
    Script:	Y:BlankInvoices.vbs
    Line:	42
    Char:	1
    Error:	ActiveX component can't create object: MODI.Document'
    Code:	800A01AD
    Source: 	Microsoft VBScript runtime error

    I found out, that there is a need to set a reference to 'Microsoft Office Document Imaging 11.0 Type Library' to get this working, but I have no idea how to do it. Unfortunately, I will probably not be able to install some external stuff to get this working. Please advise guys!

    Not a sciprting problem.  YOu wilkl have to trouble shoot this on your own.

    If these two lines fail you have some serious issue with MODI or with OCM.

    Set mdi = CreateObject("MODI.Document")
    mdi.Create("Y: est.tif")


    Put only those two lines in a ANI file with a VBS exrension.

    On a 64 bti system run the file like this:

    c:windowssyswow64cscript yourfile.vbs     //重点

    on 32 bit:

    cscript yourfile.vbs    

    If that does not work then it is likely that you have problems that cannot be solved in this forum.

     也就是说在64位环境下开发使用32位库时务必注意,曾经在64位下使用ADO,到了32位下就挂了,今天又遇到这个问题,备注下。

  • 相关阅读:
    使用truffle测试部署合约
    nodejs promise深度解析
    pthread线程特定数据
    基于信号量与互斥锁实现的生产者和消费者
    Linux coredump 的打开和关闭
    Linux 双网卡配置两个IP同时只有一个会通的原因
    进程间通信-共享内存
    进程间通信-消息队列
    TCP/IP SIGPIPE信号
    Select模式和超时
  • 原文地址:https://www.cnblogs.com/gushandujian/p/7552238.html
Copyright © 2011-2022 走看看