Message de rapport:
 

Re: objet automation et interfaces

Sujet: Re: objet automation et interfaces
par clercr sur 5/11/2007 12:21:07

Dans le code suivant, généré par l'OLE-Viewer de Visual Studio, on peut voir les 3 interfaces. Et on peut voir également qu'il y en a une par défaut. Et je n'arrive à instancier que celle-ci.
Comment instancier les autres ? (Je cherche du coté de QueryInterface, mais pour l'instant, je ne trouve pas grand chose d'exploitable : comment l'appeler ? à partir de quel objet? ...)


// Generated .IDL file (by the OLE/COM Object Viewer)
// 
// typelib filename: ibhnet.dll

[
  uuid(6B7548ED-6605-4E11-A1E1-5F0DFAD3A024),
  version(1.0),
  helpstring("IBHNet 1.0 Type Library")
]
library IBHNETLib
{
    // TLib :     // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
    importlib("stdole2.tlb");

    // Forward declare all types defined in this typelib
    interface IIIBHnet;
    interface IIIBHnet2;
    interface IIIBHnet3;

    [
      uuid(DC89DAC6-1DD1-494C-B483-A008A8DF3303),
      helpstring("IIBHnet Class")
    ]
    coclass IIBHnet {
        [default] interface IIIBHnet;
        interface IIIBHnet2;
        interface IIIBHnet3;
    };

    [
      odl,
      uuid(72D1B5E1-9ED5-44D7-8F13-8E4E8A5092E2),
      helpstring("IIIBHnet-Schnittstelle"),
      dual,
      oleautomation
    ]
    interface IIIBHnet : IDispatch {
        [id(0x00000001), helpstring("Methode FirstStation")]
        HRESULT FirstStation(BSTR* pVal);
        [id(0x00000002), helpstring("Methode NextStation")]
        HRESULT NextStation(BSTR* pVal);
        [id(0x00000003), helpstring("Methode Connect")]
        HRESULT Connect(
                        [in] BSTR Station, 
                        [in] long MPIAdr);
        [id(0x00000004), helpstring("Methode Disconnect")]
        HRESULT Disconnect();
        [id(0x00000005), helpstring("Methode ReadVal")]
        HRESULT ReadVal(
                        long typ, 
                        long nr, 
                        long DBNr, 
                        long size, 
                        long* val);
        [id(0x00000006), helpstring("Methode ReadVals")]
        HRESULT ReadVals(
                        long typ, 
                        long nr, 
                        long DBNr, 
                        long size, 
                        SAFEARRAY(unsigned char) vals);
        [id(0x00000007), helpstring("Methode WriteVal")]
        HRESULT WriteVal(
                        long typ, 
                        long nr, 
                        long DBNr, 
                        long size, 
                        long val);
        [id(0x00000008), helpstring("Methode WriteVals")]
        HRESULT WriteVals(
                        long typ, 
                        long nr, 
                        long DBNr, 
                        long size, 
                        SAFEARRAY(unsigned char) vals);
        [id(0x00000009), helpstring("Methode PLC_Store")]
        HRESULT PLC_Store();
        [id(0x0000000a), helpstring("Methode PLC_Restore")]
        HRESULT PLC_Restore();
        [id(0x0000000b), propget, helpstring("Eigenschaft PLC_RUN")]
        HRESULT PLC_Run([out, retval] long* pVal);
        [id(0x0000000c), propget, helpstring("Eigenschaft PLC_Version")]
        HRESULT PLC_Version([out, retval] long* pVal);
        [id(0x0000000d), propget, helpstring("Eigenschaft PLC_Cycles")]
        HRESULT PLC_Cycles([out, retval] long* pVal);
        [id(0x0000000e), propput, helpstring("Eigenschaft PLC_STOP")]
        HRESULT PLC_Stop([in] long rhs);
        [id(0x0000000f), propput, helpstring("Eigenschaft PLC_Run_OB100")]
        HRESULT PLC_Run_OB100([in] long rhs);
        [id(0x00000010), propput, helpstring("Eigenschaft PLC_Run_OB101")]
        HRESULT PLC_Run_OB101([in] long rhs);
        [id(0x00000011), propput, helpstring("Eigenschaft PLC_Terminate")]
        HRESULT PLC_Terminate([in] long rhs);
        [id(0x00000012), propget, helpstring("Eigenschaft PLC_SerialNr")]
        HRESULT PLC_SerialNr([out, retval] BSTR* pVal);
        [id(0x00000013), propget, helpstring("Eigenschaft PLC_Name")]
        HRESULT PLC_Name([out, retval] BSTR* pVal);
        [id(0x00000014), propget, helpstring("Eigenschaft PLC_Firma")]
        HRESULT PLC_Firma([out, retval] BSTR* pVal);
        [id(0x00000015), propget, helpstring("Eigenschaft PLC_Mlfb")]
        HRESULT PLC_Mlfb([out, retval] BSTR* pVal);
        [id(0x00000016), propget, helpstring("Eigenschaft PLC_CycleAct")]
        HRESULT PLC_CycleAct([out, retval] long* pVal);
        [id(0x00000017), propget, helpstring("Eigenschaft PLC_CycleMin")]
        HRESULT PLC_CycleMin([out, retval] long* pVal);
        [id(0x00000018), propget, helpstring("Eigenschaft PLC_CycleMax")]
        HRESULT PLC_CycleMax([out, retval] long* pVal);
        [id(0x00000019), propget, helpstring("Eigenschaft PLC_JitterMax")]
        HRESULT PLC_JitterMax([out, retval] long* pVal);
        [id(0x0000001a), propget, helpstring("Eigenschaft PLC_JitterAct")]
        HRESULT PLC_JitterAct([out, retval] long* pVal);
        [id(0x0000001b), propput, helpstring("Eigenschaft PLC_Load")]
        HRESULT PLC_Load([in] long rhs);
        [id(0x0000001c), propget, helpstring("Eigenschaft PLC_InitPath")]
        HRESULT PLC_InitPath([out, retval] BSTR* pVal);
        [id(0x0000001d), propget, helpstring("Eigenschaft PLC_MemTotal")]
        HRESULT PLC_MemTotal([out, retval] long* pVal);
        [id(0x0000001d), propput, helpstring("Eigenschaft PLC_MemTotal")]
        HRESULT PLC_MemTotal([in] long pVal);
        [id(0x0000001e), propget, helpstring("Eigenschaft PLC_MemFree")]
        HRESULT PLC_MemFree([out, retval] long* pVal);
        [id(0x0000001e), propput, helpstring("Eigenschaft PLC_MemFree")]
        HRESULT PLC_MemFree([in] long pVal);
        [id(0x0000001f), propget, helpstring("Eigenschaft MD")]
        HRESULT MD(
                        long nr, 
                        [out, retval] long* pVal);
        [id(0x0000001f), propput, helpstring("Eigenschaft MD")]
        HRESULT MD(
                        long nr, 
                        [in] long pVal);
        [id(0x00000020), propget, helpstring("Eigenschaft MW")]
        HRESULT MW(
                        long nr, 
                        [out, retval] long* pVal);
        [id(0x00000020), propput, helpstring("Eigenschaft MW")]
        HRESULT MW(
                        long nr, 
                        [in] long pVal);
        [id(0x00000021), propget, helpstring("Eigenschaft MB")]
        HRESULT MB(
                        long nr, 
                        [out, retval] long* pVal);
        [id(0x00000021), propput, helpstring("Eigenschaft MB")]
        HRESULT MB(
                        long nr, 
                        [in] long pVal);
        [id(0x00000022), propget, helpstring("Eigenschaft M")]
        HRESULT M(
                        long nr, 
                        long bit, 
                        [out, retval] long* pVal);
        [id(0x00000022), propput, helpstring("Eigenschaft M")]
        HRESULT M(
                        long nr, 
                        long bit, 
                        [in] long pVal);
        [id(0x00000023), propget, helpstring("Eigenschaft ED")]
        HRESULT ED(
                        long nr, 
                        [out, retval] long* pVal);
        [id(0x00000023), propput, helpstring("Eigenschaft ED")]
        HRESULT ED(
                        long nr, 
                        [in] long pVal);
        [id(0x00000024), propget, helpstring("Eigenschaft EW")]
        HRESULT EW(
                        long nr, 
                        [out, retval] long* pVal);
        [id(0x00000024), propput, helpstring("Eigenschaft EW")]
        HRESULT EW(
                        long nr, 
                        [in] long pVal);
        [id(0x00000025), propget, helpstring("Eigenschaft EB")]
        HRESULT EB(
                        long nr, 
                        [out, retval] long* pVal);
        [id(0x00000025), propput, helpstring("Eigenschaft EB")]
        HRESULT EB(
                        long nr, 
                        [in] long pVal);
        [id(0x00000026), propget, helpstring("Eigenschaft E")]
        HRESULT E(
                        long nr, 
                        long bit, 
                        [out, retval] long* pVal);
        [id(0x00000026), propput, helpstring("Eigenschaft E")]
        HRESULT E(
                        long nr, 
                        long bit, 
                        [in] long pVal);
        [id(0x00000027), propget, helpstring("Eigenschaft AD")]
        HRESULT AD(
                        long nr, 
                        [out, retval] long* pVal);
        [id(0x00000027), propput, helpstring("Eigenschaft AD")]
        HRESULT AD(
                        long nr, 
                        [in] long pVal);
        [id(0x00000028), propget, helpstring("Eigenschaft AW")]
        HRESULT AW(
                        long nr, 
                        [out, retval] long* pVal);
        [id(0x00000028), propput, helpstring("Eigenschaft AW")]
        HRESULT AW(
                        long nr, 
                        [in] long pVal);
        [id(0x00000029), propget, helpstring("Eigenschaft AB")]
        HRESULT AB(
                        long nr, 
                        [out, retval] long* pVal);
        [id(0x00000029), propput, helpstring("Eigenschaft AB")]
        HRESULT AB(
                        long nr, 
                        [in] long pVal);
        [id(0x0000002a), propget, helpstring("Eigenschaft A")]
        HRESULT A(
                        long nr, 
                        long bit, 
                        [out, retval] long* pVal);
        [id(0x0000002a), propput, helpstring("Eigenschaft A")]
        HRESULT A(
                        long nr, 
                        long bit, 
                        [in] long pVal);
        [id(0x0000002b), propget, helpstring("Eigenschaft DD")]
        HRESULT DD(
                        long DBNr, 
                        long nr, 
                        [out, retval] long* pVal);
        [id(0x0000002b), propput, helpstring("Eigenschaft DD")]
        HRESULT DD(
                        long DBNr, 
                        long nr, 
                        [in] long pVal);
        [id(0x0000002c), propget, helpstring("Eigenschaft DW")]
        HRESULT DW(
                        long DBNr, 
                        long nr, 
                        [out, retval] long* pVal);
        [id(0x0000002c), propput, helpstring("Eigenschaft DW")]
        HRESULT DW(
                        long DBNr, 
                        long nr, 
                        [in] long pVal);
        [id(0x0000002d), propget, helpstring("Eigenschaft DB")]
        HRESULT DB(
                        long DBNr, 
                        long nr, 
                        [out, retval] long* pVal);
        [id(0x0000002d), propput, helpstring("Eigenschaft DB")]
        HRESULT DB(
                        long DBNr, 
                        long nr, 
                        [in] long pVal);
        [id(0x0000002e), propget, helpstring("Eigenschaft D")]
        HRESULT D(
                        long DBNr, 
                        long nr, 
                        long bit, 
                        [out, retval] long* pVal);
        [id(0x0000002e), propput, helpstring("Eigenschaft D")]
        HRESULT D(
                        long DBNr, 
                        long nr, 
                        long bit, 
                        [in] long pVal);
        [id(0x0000002f), propget, helpstring("Eigenschaft Station")]
        HRESULT Station(
                        long nr, 
                        [out, retval] BSTR* pVal);
    };

    [
      odl,
      uuid(9488FED9-8D4A-42EB-836B-335222C68AAE),
      helpstring("IIIBHnet2-Schnittstelle"),
      dual,
      oleautomation
    ]
    interface IIIBHnet2 : IDispatch {
        [id(0x00000001), helpstring("Methode ResetDevice")]
        HRESULT ResetDevice(BSTR device);
        [id(0x00000002), propget, helpstring("Eigenschaft Key_Position")]
        HRESULT Key_Position([out, retval] long* pVal);
        [id(0x00000003), helpstring("Methode LifeList")]
        HRESULT LifeList(
                        BSTR device, 
                        VARIANT* LifeList);
        [id(0x00000004), helpstring("Methode SZ_List")]
        HRESULT SZ_List(
                        long SZL_ID, 
                        long INDEX, 
                        VARIANT* SZ_List);
        [id(0x00000005), helpstring("Methode TerminateDriver")]
        HRESULT TerminateDriver();
    };

    [
      odl,
      uuid(C147DF8F-0D43-4580-A8FA-FD597F79610E),
      helpstring("IIIBHnet3-Schnittstelle"),
      dual,
      oleautomation
    ]
    interface IIIBHnet3 : IDispatch {
        [id(0x00000001), helpstring("Methode Connect_DP")]
        HRESULT Connect_DP(
                        BSTR Station, 
                        long DPAdr, 
                        long Rack, 
                        long Slot);
        [id(0x00000002), helpstring("Methode Subnet_Connect_DP")]
        HRESULT Subnet_Connect_DP(
                        BSTR Station, 
                        long MPIStart, 
                        long MPIZiel, 
                        long RackZiel, 
                        long SlotZiel, 
                        long Subnet_HH, 
                        long Subnet_LL);
        [id(0x00000003), helpstring("Methode Subnet_Connect_IP")]
        HRESULT Subnet_Connect_IP(
                        BSTR Station, 
                        long MPIStart, 
                        BSTR IPZiel, 
                        long RackZiel, 
                        long SlotZiel, 
                        long Subnet_HH, 
                        long Subnet_LL);
        [id(0x00000004), helpstring("Methode SubnetConnectH1")]
        HRESULT SubnetConnectH1(
                        BSTR Station, 
                        long MPIStart, 
                        BSTR H1Ziel, 
                        long RackZiel, 
                        long SlotZiel, 
                        long Subnet_HH, 
                        long Subnet_LL);
        [id(0x00000005), helpstring("Methode ReadDB")]
        HRESULT ReadDB(
                        long DBNr, 
                        VARIANT* DB, 
                        long* Len);
        [id(0x00000006), helpstring("Methode WriteDB")]
        HRESULT WriteDB(
                        long DBNr, 
                        VARIANT DB, 
                        long Len);
        [id(0x00000007), helpstring("Methode DotNetReadVals")]
        HRESULT DotNetReadVals(
                        long typ, 
                        long nr, 
                        long DBNr, 
                        long size, 
                        VARIANT* vals);
        [id(0x00000008), helpstring("Methode DotNetWriteVals")]
        HRESULT DotNetWriteVals(
                        long typ, 
                        long nr, 
                        long DBNr, 
                        long size, 
                        VARIANT vals);
    };
};


Connexion
Menu
Chercher WDForge
Chercher Web
Partenaires
Visualiser tous les Partenaires...
WinDev, WebDev, WinDev Mobile et HyperFile sont des marques déposées par PCSoft. |  Voter |  Legal |  Contact |   XOOPS 2.0.13.2