(1) 2 »


objet automation et interfaces
Stagiaire WDF
Inscrit:
31/10/2007 12:20
Post(s): 22
Je dois utiliser une dll contenant une classe.
Cette classe contient 3 interfaces. (vu avec WDTypeLib)
Lorsque je déclare un objet
intf est objet automation "IBHnet.dll" 


je n'ai accès qu'aux fontions d'une seule interface sur les 3...
merci.

Attacher un fichier:



jpg  TypeLib.JPG (79.54 KB)
2964_472867aace31e.jpg 905X762 px

Contribution le : 31/10/2007 12:32
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Animateur WDF
Inscrit:
02/03/2003 04:07
De Noisy le grand(93)
Post(s): 2745
Bonjour,

certaines interfaces ne sont pas accessible directement et doivent être déclarées en tant qu'objet automation dynamique
et sont alimenté par l'objet de base.

Pour savoir comment cela fonctionne est nécessaire d'avoir la documentation ou bien un exemple de code meme dans un autre langage.

oExcel est un objet automation "Excel.Application"
oWorkBook est un objet automation dynamique

oWorkBook = oExcel>>Workbooks(1)

ici aussi oWorkbook est dynamique et il est alimenté par l'objet de base oExcel

Contribution le : 31/10/2007 13:13
_________________
@A+
Contact (privé)......
email : drcharly@wdforge.org
[DrCharly93]
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Stagiaire WDF
Inscrit:
31/10/2007 12:20
Post(s): 22
Merci pour la réponse.

voici ce qui fonctionne en VB
Déclaration:
Dim IBHNet As IIBHnet
Dim IBHNet2 As IIIBHnet2
Dim IBHNet3 As IIIBHnet3


Dans Form Load
Set IBHNet = New IIBHnet
Set IBHNet2 = IBHNet
Set IBHNet3 = IBHNet


Puis au premier clic
IBHNet3.Connect_DP Text1.Text, Val(Text2.Text), 0, Val(Text3.Text)


Mais avec Windev, impossible d'accéder aux fonctions de INHnet3.

Attacher un fichier:



jpg  TypeLib2.JPG (30.63 KB)
2964_472873b36db5e.jpg 666X325 px

Contribution le : 31/10/2007 13:23
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Animateur WDF
Inscrit:
02/03/2003 04:07
De Noisy le grand(93)
Post(s): 2745
En WLangage cela se traduit de la façon suivante:

//Déclaration
IBHNet est un objet automation dynamique  
IBHNet2 est un objet automation dynamique
IBHNet3 est un objet automation dynamique

Au chargement
IBHNet = New "IBHnet.dll"
//ou
//IBHNET = allouer un objet automation "IBHnet.dll"
IBHNet2 = IBHNet //Ici il manque une methode
IBHNet3 = IBHNet //Ici il manque une méthode

Puis au premier clic
IBHNet3>>Connect_DP(<Texte>, <Valeur2>, 0, <Valeur3>)

Contribution le : 31/10/2007 13:31
_________________
@A+
Contact (privé)......
email : drcharly@wdforge.org
[DrCharly93]
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Stagiaire WDF
Inscrit:
31/10/2007 12:20
Post(s): 22
Merci mais ça ne fonctionne pas.
je joints la Dll pour test ?? (http://www.richardclerc.com/IBHNet.dll)

3 jours que je suis sur le sujet, et je désespère !
merci d'avance.

Contribution le : 31/10/2007 13:49
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Animateur WDF
Inscrit:
02/03/2003 04:07
De Noisy le grand(93)
Post(s): 2745
Malheureusement, je n'ai rien pour tester et la dll seule ne fonctionne pas sur mon poste même avec vb.

Contribution le : 31/10/2007 15:24
_________________
@A+
Contact (privé)......
email : drcharly@wdforge.org
[DrCharly93]
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Stagiaire WDF
Inscrit:
31/10/2007 12:20
Post(s): 22
Et puis-je mettre à disposition le pilote qui installe la dll ?? (au cas ou oui : http://www.ibhsoftec-sps.de/english/downloads/Updates/IBHNet127.exe )

Votre outil WDTypeLib arrive a trouver les interfaces et les membres de ces interfaces. donc ça doit être possible...mais comment ??

cordialement,
Richard

Contribution le : 31/10/2007 16:19
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Stagiaire WDF
Inscrit:
31/10/2007 12:20
Post(s): 22
Bonjour,
Comment WDTypeLib fait-il pour énumérer les Classes, interfaces de classes et membres de ces interfaces ?
Si je comprends ça, je pourrais certainement trouver ma solution.
y a-t-il quelqu'un qui s'interesse à mon sujet ?

merci d'avance.

Contribution le : 02/11/2007 09:17
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Animateur WDF
Inscrit:
02/03/2003 04:07
De Noisy le grand(93)
Post(s): 2745
Bonjour,

Je n'ai pas de périphérique mais je suis arrivé a refaire le projet CPUInfos qui exist en VB en WinDev et je n'ai aucune erreur tout a l'air de fonctionner.

Contribution le : 02/11/2007 11:50
_________________
@A+
Contact (privé)......
email : drcharly@wdforge.org
[DrCharly93]
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Stagiaire WDF
Inscrit:
31/10/2007 12:20
Post(s): 22
As-tu réussi à utiliser les méthodes de l'interface IIIBHNet3 ? (Connect_DP par exemple)

Contribution le : 03/11/2007 09:20
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Stagiaire WDF
Inscrit:
31/10/2007 12:20
Post(s): 22
Voici l'exemple en VB qui utilise l'interface IIIBHnet3

Dim connected As Boolean

Dim IBHNet As IIBHnet
Dim IBHNet2 As IIIBHnet2
Dim IBHNet3 As IIIBHnet3



Private Sub BTN_Read_Click()
    MW10 = IBHNet.MW(10)
End Sub

Private Sub BTN_WRITE_Click()
    IBHNet.MW(10) = MW10
End Sub

Private Sub Command3_Click()
    MD10 = IBHNet.MD(10)
End Sub

Private Sub Command4_Click()
    IBHNet.MD(10) = MD10
End Sub

Private Sub Command5_Click()
    res = IBHNet.PLC_MemFree
End Sub

Private Sub Command6_Click()
    res = IBHNet.PLC_Run
End Sub

Private Sub Command7_Click()
    IBHNet.DW(1, 0) = DB1DBW0
End Sub

Private Sub Command8_Click()
    DB1DBW0 = IBHNet.DW(1, 0)
End Sub

Private Sub Form_Load()

Set IBHNet = New IIBHnet
Set IBHNet2 = IBHNet
Set IBHNet3 = IBHNet

connected = False

End Sub

Private Sub Form_Unload(Cancel As Integer)

Set IBHNet3 = Nothing
Set IBHNet2 = Nothing
Set IBHNet = Nothing

End Sub

Private Sub Command1_Click()

Dim ret As Long
On Error GoTo MyError
If (connected = False) Then IBHNet3.Connect_DP Text1.Text, Val(Text2.Text), 0, Val(Text3.Text)

If (ret = 0) Then
    MsgBox ("Connected" & Str(ret))
    connected = True
End If
GoTo Fin

MyError:
    MsgBox ("Fehler")
Fin:
End Sub

Private Sub Command2_Click()

If (connected = True) Then IBHNet.Disconnect
connected = False

End Sub

Private Sub Text4_Change()

End Sub




merci encore.

Attacher un fichier:



jpg  IBHTest.JPG (91.92 KB)
2964_472ecd65268c4.jpg 573X494 px

Contribution le : 05/11/2007 09:00
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Animateur WDF
Inscrit:
02/03/2003 04:07
De Noisy le grand(93)
Post(s): 2745
Bonjour,

Ci joint le projet CPUInfo transcrit en WinDev

Attacher un fichier:


zip CPUInfos.zip Taille: 79.46 KB; Hits: 357

Contribution le : 05/11/2007 12:12
_________________
@A+
Contact (privé)......
email : drcharly@wdforge.org
[DrCharly93]
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Stagiaire WDF
Inscrit:
31/10/2007 12:20
Post(s): 22
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);
    };
};


Contribution le : 05/11/2007 12:21
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Stagiaire WDF
Inscrit:
31/10/2007 12:20
Post(s): 22
voici le dernier exemple founir par le fabricant :
http://www.richardclerc.com/c++_builder5_if3.zip

merci.

Contribution le : 05/11/2007 14:10
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Animateur WDF
Inscrit:
02/03/2003 04:07
De Noisy le grand(93)
Post(s): 2745
Bonjour,

Peut être une piste
en c++ l'accès se fait par :
Citation :

hr = pIBH3->Subnet_Connect_DP( ws.Copy(), // BSTR Station
MPI->Text.ToInt(), // immidiates MPI/DP Address,
8, // remote MPI/DP Address,
0, // remote Station Racknumber,
2, // remote Station CPU slotnumber,
0x0123, // Subnet ID LOW like in Siemens Project
0x4567); // Subnet ID HIGH like in Siemens Project

Alors peut être:
IBHNet3>>Subnet_Connect_DP(<Station>,<DP Adress>,<Remote DP>,<Remote Station>,<remote station CPU>,<Subnet ID LOW>,<Subnet ID HIGHT>)

Contribution le : 05/11/2007 15:40
_________________
@A+
Contact (privé)......
email : drcharly@wdforge.org
[DrCharly93]
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Stagiaire WDF
Inscrit:
31/10/2007 12:20
Post(s): 22
Désolé, je ne me suis pas fait comprendre.
cette Dll contient 1 objet automation IINHNet qui implémente 3 interfaces (IIIBHNet,IIIHNet2,IIIBHNet3) dont 1 par défaut: IIIBHNet
Et je ne sais pas comment faire pour pouvoir utiliser les méthodes de l'interface IIIBHNet3, qui semble inaccessible.
En VB, dans les exemples fournis, un objet IIBHnet est défini, ainsi que des objets utilisant les autres interfaces.
Dim IBHNet As IIBHnet
Dim IBHNet2 As IIIBHnet2
Dim IBHNet3 As IIIBHnet3


Et cela suffit pour fonctionner.

Mais en Windev, je n'ai réussi à instancier qu'un objet IIBHNet, ce qui me donne accès aux fonctions de l'interface par défaut (IIIBHNet), mais pa

Contribution le : 05/11/2007 15:54
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Stagiaire WDF
Inscrit:
31/10/2007 12:20
Post(s): 22
Désolé, je ne me suis pas fait comprendre:

cette Dll contient 1 objet automation IINHNet qui implémente 3 interfaces (IIIBHNet,IIIHNet2,IIIBHNet3) dont 1 par défaut: IIIBHNet (vu avec OLE-View ou WDTypeLib)
Et je ne sais pas comment faire pour pouvoir utiliser les méthodes de l'interface IIIBHNet3, qui semble inaccessible (tout comme IIIBHNet2 d'ailleurs).
En VB, dans les exemples fournis, un objet IIBHnet est défini, ainsi que des objets utilisant les autres interfaces.
Dim IBHNet As IIBHnet
Dim IBHNet2 As IIIBHnet2
Dim IBHNet3 As IIIBHnet3


Et cela suffit pour fonctionner.

Mais en Windev, je n'ai réussi à instancier qu'un objet IIBHNet, ce qui me donne accès aux fonctions de l'interface par défaut (IIIBHNet), mais pas aux autres. Et bien évidemment, c'est de la fonction Connect_DP de l'interface IIIBHNet3 dont j'ai besoin.
Je suppose que la fonction OLE QueryInterface est mon allié, mais comment et pourquoi ???

merci

Contribution le : 05/11/2007 15:57
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Stagiaire WDF
Inscrit:
31/10/2007 12:20
Post(s): 22
Personne pour m'aider ??

Contribution le : 06/11/2007 12:03
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Animateur WDF
Inscrit:
02/03/2003 04:07
De Noisy le grand(93)
Post(s): 2745
Pas fautes de regarder mais avec ma capuche je vois rien
Voir QueryInterface

Contribution le : 06/11/2007 13:45

Edité par drcharly93 sur 6/11/2007 14:52:49
_________________
@A+
Contact (privé)......
email : drcharly@wdforge.org
[DrCharly93]
Créer un fichier PDF de la contribution Imprimer


Re: objet automation et interfaces
Stagiaire WDF
Inscrit:
31/10/2007 12:20
Post(s): 22
Et comment WDTypeLib fait-il pour identifier les interfaces présentes ??

Contribution le : 06/11/2007 15:53
Créer un fichier PDF de la contribution Imprimer



 Haut   Précédent   Suivant
(1) 2 »




Enregistrer votre réponse
CompteNom   Mot de passe   Authentification
Message:


Vous ne pouvez pas débuter de nouveaux sujets.
Vous pouvez voir les sujets.
Vous ne pouvez pas répondre aux contributions.
Vous ne pouvez pas éditer vos contributions.
Vous ne pouvez pas effacez vos contributions.
Vous ne pouvez pas ajouter de nouveaux sondages.
Vous ne pouvez pas voter en sondage.
Vous ne pouvez pas attacher des fichiers à vos contributions.
Vous ne pouvez pas poster sans approbation.

[Recherche avancée]


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