locked
MSSCRIPT.OCX with 64 bit platforms RRS feed

  • Question

  • In a C++ (compiled with VS2005 x64 platform)

     

    I Use

    #import <msscript.ocx>

     

    and then I use:

     

    hr = pScript->raw_AddObject(_bstr_t(strId), pObject->GetIDispatch(TRUE), VARIANT_TRUE);

    hr = pScript->raw_AddCode(_bstr_t(strSource));

    hr = pScript->raw_Eval(_bstr_t(strMethod), (LPVARIANT)vResult);

    hr = pScript->raw_Run(_bstr_t(strMethod), aParms.GetData(), (LPVARIANT)vResult);

    MSScriptControl::IScriptProcedurePtr pProc = pProcs->GetItem(COleVariant(i, VT_I4))

     

    but at runtime on a Windows Server 2003 64 bits:

     

    HRESULT hr = ::CoCreateInstance(

    __uuidof(MSScriptControl:Tongue TiedcriptControl),

    NULL,

    CLSCTX_ALL,

     __uuidof(MSScriptControl::IScriptControl),

    (LPVOID*)&pScript

    );

     

    give me an error because MSSCRIPT.OCX doesn't exist on 64 bit System32 directory

     

    Can you help me?

     

    thanks,

    Andrea


     

     

    Tuesday, May 27, 2008 10:40 AM

Answers

  • Find somebody with a x64 version of Vista.  You can probably guess what to do from there, I'm pretty sure that it violates the license terms.
    • Marked as answer by Yan-Fei Wei Monday, June 2, 2008 6:00 AM
    Tuesday, May 27, 2008 1:04 PM

All replies

  • Find somebody with a x64 version of Vista.  You can probably guess what to do from there, I'm pretty sure that it violates the license terms.
    • Marked as answer by Yan-Fei Wei Monday, June 2, 2008 6:00 AM
    Tuesday, May 27, 2008 1:04 PM
  • ok, thanks. I'll try to install a x64 Vista.

     

    Andrea

    Thursday, May 29, 2008 11:11 AM
  • MSScript.OCX is x86 only. A 64-bit version does not exist.
    Friday, September 12, 2008 11:35 PM
  • I've got one.
    Hans Passant.
    Saturday, September 13, 2008 12:03 AM
  •  
    nobugz said:

    I've got one.


    Hans Passant.



    Can you tell me where you got a 64 bit version?

    I need it. Thanks.

    Wednesday, March 11, 2009 9:44 PM
  • Read the entire thread.
    Hans Passant.
    Wednesday, March 11, 2009 10:19 PM
  • nobugz said:

    Read the entire thread.


    Hans Passant.



    I did.
     
    Paul Dempsey says that a 64 bit version does not exist. That's what I've found. Vista-64 and W2K8-64 look like this:

    C:\>dir msscript* /b /s
    C:\Windows\SysWOW64\msscript.ocx
    C:\Windows\SysWOW64\en-US\msscript.ocx.mui
    C:\Windows\winsxs\x86_microsoft-windows-s..-msscript.resources_31bf3856ad364e35_
    6.0.6000.16386_en-us_cc9da755bc489be4\msscript.ocx.mui
    C:\Windows\winsxs\x86_microsoft-windows-scripting-msscript_31bf3856ad364e35_6.0.
    6000.16386_none_8e2b0138a6cfd0b3\msscript.ocx

    SysWOW64 is the 32 bit directory. You replied that "I've got one". So if you have a 64 bit version of msscript.ocx, where did you get it? Or did I misunderstand your reply?

     

    Friday, March 13, 2009 2:01 PM
  • Yes, I've got one located in c:\windows\system32, the folder where 64-bit executables are stored.  It has the same date as other basic Windows binaries, like shlwapi.dll.  January 20th, 2008.  Vista x64 Business, US English, SP1.
    Hans Passant.
    Friday, March 13, 2009 5:51 PM
  • I've got Vista business 64 with SP1. I even download IE 8. Still no msscript.ocx. If you've got a real x64 version, then there should be 2 different files. One in system32, and the other in syswow64. They should be different sizes like cscript is.

    Are you able to create the interop using the sdk? "TlbImp c:\windows\system32\msscript.ocx /machine:X64"

    C:\>dir msscript.ocx /s
     Volume in drive C has no label.
     Volume Serial Number is C84F-D68E

     Directory of C:\Windows\SysWOW64

    01/18/2008  11:33 PM           110,592 msscript.ocx
                   1 File(s)        110,592 bytes


    C:\>dir cscript.exe /s
     Volume in drive C has no label.
     Volume Serial Number is C84F-D68E

     Directory of C:\Windows\System32

    05/08/2008  02:05 AM           147,968 cscript.exe
                   1 File(s)        147,968 bytes

     Directory of C:\Windows\SysWOW64

    05/08/2008  05:58 PM           135,168 cscript.exe
                   1 File(s)        135,168 bytes


    Friday, March 13, 2009 8:22 PM
  • What's the file name?  msscript.ocx only exists C:\Windows\SysWOW64.
    Wednesday, May 25, 2011 5:58 AM
  • I'm looking for a 64 bit msscript.ocx too. So I installed

    - Windows XP 64 bit

    - Windows Vista Ultimate SP 2 64 bit

    - Windows Vista Business SP 1 64 bit

    - Windows Server 2008 64 bit

    And none of them have a 64 bit msscript.ocx.

    However if you use a 32 bit Cmd.exe, or 32 bit 4nt.exe the 64 bit system will map the SysWow64 map to the system32 map. So you think you have a msscript.ocx in the system32 map which actually is the one in SysWow64 which is 32 bit.

    Does anyone have a 64 bit msscript.ocx?

    Sunday, June 26, 2011 2:50 PM
  • Does anyone have a 64-bit msscript.ocx?

    I need one as well.

    Please help.

    Thursday, October 6, 2011 7:05 PM
  •  

    Are you able to create the interop using the sdk? "TlbImp c:\windows\system32\msscript.ocx /machine:X64"

    @Dave From TE

    I think thats probably how he created the library but i dont know.


    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda
    Saturday, February 4, 2012 8:30 PM
  • You have to do an out of process  Com application (32 bit) and then use CoCreateInstance to instantiate it in a 64 bit application.

    In this out of process application you have to implement all the methods that you use in your old 32 bit application:

    example;

    .h

    class ATL_NO_VTABLE CMyComMSSCRIPT : 
    public CComObjectRootEx<CComMultiThreadModel>,
    public CComCoClass<CMyComMSSCRIPT, &CLSID_MyComMSSCRIPT>,
    public IDispatchImpl<IMyComMSSCRIPT , &IID_IMyComMSSCRIPT , &LIBID_MyComMSSCRIPT >
    {
    public:
    DECLARE_CLASSFACTORY_SINGLETON(CMyComMSSCRIPT )
    CMyComMSSCRIPT ();
    virtual ~CMyComMSSCRIPT ();


    DECLARE_REGISTRY_RESOURCEID(IDR_MyComMSSCRIPT )


    DECLARE_PROTECT_FINAL_CONSTRUCT()


    BEGIN_COM_MAP(CMyComMSSCRIPT )
    COM_INTERFACE_ENTRY(IMyComMSSCRIPT )
    COM_INTERFACE_ENTRY(IDispatch)
    END_COM_MAP()


    // IMyComMSSCRIPT 
    public:

    STDMETHOD(Eval)(/*[in]*/ BSTR strMethod, /*[out]*/ LPVARIANT vResult);

    etc.....

    .cpp

    STDMETHODIMP CMyComMSSCRIPT::Eval(BSTR strMethod, LPVARIANT vResult)
    {

    AFX_MANAGE_STATE(AfxGetStaticModuleState())

    MSScriptControl::IScriptControl* pScript = NULL;

    HRESULT hr = ::CoCreateInstance(
    __uuidof(MSScriptControl::ScriptControl), NULL, 
    CLSCTX_ALL, __uuidof(MSScriptControl::IScriptControl), 
    (LPVOID*)&pScript);

    if (pScript) {

    HRESULT hr;

    CString method(strMethod);

    COleVariant risultato;

    hr = pScript->raw_Eval(_bstr_t(strMethod), (LPVARIANT)&risultato);

    ::VariantCopy(vResult, &risultato);
    return hr; 
    }

    return E_FAIL;
    }

    In the 64 bit application

    IMyComMSSCRIPT* pvb=NULL;  
    try{  
    hr = CoCreateInstance(CLSID_MyComMSSCRIPT, NULL,
    CLSCTX_ALL, IID_IMyComMSSCRIPT,(void**) &pvb);
    if (SUCCEEDED(hr)){  
    pvb->Eval(......);
    }
    }
    catch(...) {
    }

    Tuesday, March 27, 2012 4:06 PM