!!!!为什么我写的组件,用vbscript可以调用其中的函数,为什么用javascript不可以!!#@&*,救命啊!!SOS!!

解决方案 »

  1.   

    // upload.idl : ActiveX 控件项目的类型库源。// 此文件将由 MIDL 编译器工具处理以
    //产生类型库(upload.tlb),该类型库将成为 
    // upload.ocx 中的资源。#include <olectl.h>
    #include <idispids.h>[ uuid(F914E67E-9B04-4072-BACF-DF5093A95C1F), version(1.0),
      helpfile("upload.hlp"),
      helpstring("upload ActiveX 控件模块"),
      control ]
    library uploadLib
    {
    importlib(STDOLE_TLB); //  CuploadCtrl 的主调度接口 [ uuid(1E40AC48-71D7-46F6-91FF-BC524E4387C8),
      helpstring("upload Control 的调度接口")]
    dispinterface _Dupload
    {
    properties:
    methods: [id(DISPID_ABOUTBOX)] void AboutBox();
    [id(1), helpstring("方法getsize")] BSTR getsize(BSTR filename);

    [id(2), helpstring("方法sendfile")] BSTR sendfile(BSTR filename, BSTR dir);
    [id(3), helpstring("方法test")] BSTR test(void);
    }; //  CuploadCtrl 的事件调度接口 [ uuid(F2133935-2E37-46F8-B1F3-C4ED091F9E14),
      helpstring("upload Control 的事件接口") ]
    dispinterface _DuploadEvents
    {
    properties:
    //  事件接口没有任何属性 methods:
    }; //  CuploadCtrl 的类信息 [ uuid(CDC8F47C-493F-4B50-8DC0-D3683D1A1F0A),
      helpstring("upload Control"), control ]
    coclass upload
    {
    [default] dispinterface _Dupload;
    [default, source] dispinterface _DuploadEvents;
    };};