IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

 Delphi Discussion :

Appel de fonction d'une dll dont la localisation peut changer d'un utilisateur à un autre


Sujet :

Delphi

  1. #1
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2003
    Messages
    439
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2003
    Messages : 439
    Points : 161
    Points
    161
    Par défaut Appel de fonction d'une dll dont la localisation peut changer d'un utilisateur à un autre
    Bonjour,

    Dans mon projet D10, je dois faire appel à une fonction d'une dll située à divers endroits selon les utilisateurs.
    Comment utiliser le mot clé "external" dans ce cas. Il ne semble pas accepter la concaténation.

    Merci de votre aide.

    Cordialement
    Pierre

  2. #2
    Modérateur
    Avatar de tourlourou
    Homme Profil pro
    Biologiste ; Progr(amateur)
    Inscrit en
    Mars 2005
    Messages
    3 852
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Biologiste ; Progr(amateur)

    Informations forums :
    Inscription : Mars 2005
    Messages : 3 852
    Points : 11 285
    Points
    11 285
    Billets dans le blog
    6
    Par défaut
    Si ces divers endroits font tous partie des chemins de recherche par défaut de Windows, ne rien faire d'autre que de mettre external mylib.dll, sans chemin. Si ce n'est pas le cas, faire un chargement dynamique (LoadLibrary) au lieu de statique, en constituant le chemin à l'exécution.
    NB : pê est-il possible de donner des chemins supplémentaires à la recherche des dll ?
    Delphi 5 Pro - Delphi 11.3 Alexandria Community Edition - CodeTyphon 6.90 sous Windows 10 ; CT 6.40 sous Ubuntu 18.04 (VM)
    . Ignorer la FAQ Delphi et les Cours et Tutoriels Delphi nuit gravement à notre code !

  3. #3
    Expert éminent sénior
    Avatar de ShaiLeTroll
    Homme Profil pro
    Développeur C++\Delphi
    Inscrit en
    Juillet 2006
    Messages
    13 447
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Développeur C++\Delphi
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2006
    Messages : 13 447
    Points : 24 844
    Points
    24 844
    Par défaut
    Tu ne l'utilises pas !
    Tu passes par LoadLibrary et GetProcAddress : Voir la Comment appeler une fonction dans une DLL ? qui explique les deux méthodes
    Aide via F1 - FAQ - Guide du développeur Delphi devant un problème - Pensez-y !
    Attention Troll Méchant !
    "Quand un homme a faim, mieux vaut lui apprendre à pêcher que de lui donner un poisson" Confucius
    Mieux vaut se taire et paraître idiot, Que l'ouvrir et de le confirmer !
    L'ignorance n'excuse pas la médiocrité !

    L'expérience, c'est le nom que chacun donne à ses erreurs. (Oscar Wilde)
    Il faut avoir le courage de se tromper et d'apprendre de ses erreurs

  4. #4
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2003
    Messages
    439
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2003
    Messages : 439
    Points : 161
    Points
    161
    Par défaut
    Merci à vous deux, Je vais voir cela et revenir pour un rapport.

    Cordialement
    Pierre

  5. #5
    Expert éminent sénior
    Avatar de Paul TOTH
    Homme Profil pro
    Freelance
    Inscrit en
    Novembre 2002
    Messages
    8 964
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Freelance
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2002
    Messages : 8 964
    Points : 28 430
    Points
    28 430
    Par défaut
    il existe tout de même une astuce possible sous Windows

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
     
     
    function mafonction(params):type; external 'SOMEWHERE' delayed; // mot clé delayed !!
     
    // reste à enregistrer un gestionnaire de chargement spécifique
     
    var
      LoadHook: TDelayedLoadHook;
      Somewhere: THandle;
     
    function MyHook(dliNotify: dliNotification; pdli: PDelayLoadInfo): Pointer; stdcall;
    begin
      if (dliNotify = dliNotePreLoadLibrary) and (pdli.szDll = 'SOMEWHERE') then
      begin
         Somewhere := .... charger la DLL là où elle se trouve...
         Result := Pointer(Somewhere);
         Exit;
      end;
      if @LoadHook <> nil then
        Result := LoadHook(dliNotify, pdli)
      else
    	Result := nil;
    end;
     
    initialization
      Handle := 0;
      LoadHook := SetDliNotifyHook2(MyHook);
    finalization
      SetDliNotifyHook2(LoadHook);
    et le tour est joué
    Developpez.com: Mes articles, forum FlashPascal
    Entreprise: Execute SARL
    Le Store Excute Store

  6. #6
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2003
    Messages
    439
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2003
    Messages : 439
    Points : 161
    Points
    161
    Par défaut
    Bonsoir,
    Après quelques tests, j'obtiens un résultat vide de données:
    Voici le fruit de mes recherches:

    Ici la structure donnée par l'auteur de l'API utilisée
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    TWxData = Record
      AltFt: Integer;// Out
      Pressure: Double;//In
      Temperature: Double;//In
      WindDirection: Double;//In
      WindSpeed:Double;//In
    La procedure qui appelle la fonction (GetAtmosphere) en cours de développement
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    Procedure LoadAsWx;
    var
      WxLat: Double;
      WxLon: Double;
      WxTime_Shift: Byte;
      WxData: array[0..0] of TWxData;
      WxDataSize: Byte;
      HandleDLL: THandle;
      GetAtmosphere: function(Lat: Double; Lon: Double; Time_Offset: Byte;
                              Data: Array of TWxData; Data_Size: Byte): Boolean;
    begin
      GetAtmosphere:= nil;
      HandleDLL:= LoadLibrary(pWideChar('D:\Program Files (x86)\HiFi\AS16_P3D' + '\as_srv\as_btstrp.dll'));
      if HandleDLL = 0 then Exit;
      GetAtmosphere:= GetProcAddress(HandleDLL, pAnsiChar('GetAtmosphere'));
      WxLat:= 40.520843;
      WxLon:= 22.971601;
      WxTime_Shift:= 0;
      WxData[0].AltFt:= 10000;
      WxDataSize:= 1;
      if GetAtmosphere(WxLat, WxLon, WxTime_Shift ,WxData, WxDataSize) then
      begin
        ShowMessage(FloatToStr(WxData[0].Pressure));
      end;
    end;
    que puis-je faire?

    Cordialement
    Pierre

  7. #7
    Expert éminent sénior
    Avatar de Paul TOTH
    Homme Profil pro
    Freelance
    Inscrit en
    Novembre 2002
    Messages
    8 964
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Freelance
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2002
    Messages : 8 964
    Points : 28 430
    Points
    28 430
    Par défaut
    1) ne jamais utiliser un "array of" dans un appel de DLL ! un tel tableau exige des paramètres complémentaires, comme la taille du tableau !

    2) 99% des API utilisent la convention stdcall

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
    type
      PWxData = ^TWxData;
     
    function(Lat: Double; Lon: Double; Time_Offset: Byte;
                              out Data: PWxData; Data_Size: Byte): Boolean; stdcall;
     
    if GetAtmosphere(WxLat, WxLon, WxTime_Shift ,@WxData[0], WxDataSize) then
    Citation Envoyé par Pierre95 Voir le message
    Bonsoir,
    Après quelques tests, j'obtiens un résultat vide de données:
    Voici le fruit de mes recherches:

    Ici la structure donnée par l'auteur de l'API utilisée
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    TWxData = Record
      AltFt: Integer;// Out
      Pressure: Double;//In
      Temperature: Double;//In
      WindDirection: Double;//In
      WindSpeed:Double;//In
    La procedure qui appelle la fonction (GetAtmosphere) en cours de développement
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    Procedure LoadAsWx;
    var
      WxLat: Double;
      WxLon: Double;
      WxTime_Shift: Byte;
      WxData: array[0..0] of TWxData;
      WxDataSize: Byte;
      HandleDLL: THandle;
      GetAtmosphere: function(Lat: Double; Lon: Double; Time_Offset: Byte;
                              Data: Array of TWxData; Data_Size: Byte): Boolean;
    begin
      GetAtmosphere:= nil;
      HandleDLL:= LoadLibrary(pWideChar('D:\Program Files (x86)\HiFi\AS16_P3D' + '\as_srv\as_btstrp.dll'));
      if HandleDLL = 0 then Exit;
      GetAtmosphere:= GetProcAddress(HandleDLL, pAnsiChar('GetAtmosphere'));
      WxLat:= 40.520843;
      WxLon:= 22.971601;
      WxTime_Shift:= 0;
      WxData[0].AltFt:= 10000;
      WxDataSize:= 1;
      if GetAtmosphere(WxLat, WxLon, WxTime_Shift ,WxData, WxDataSize) then
      begin
        ShowMessage(FloatToStr(WxData[0].Pressure));
      end;
    end;
    que puis-je faire?

    Cordialement
    Pierre
    Developpez.com: Mes articles, forum FlashPascal
    Entreprise: Execute SARL
    Le Store Excute Store

  8. #8
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2003
    Messages
    439
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2003
    Messages : 439
    Points : 161
    Points
    161
    Par défaut
    Bonjour,

    Merci Paul pour ces précisions.

    Voici ce que l'auteur de l'API donne comme renseignements:
    Weather information at a specified location can also be obtained directly through API function GetAtmoshere that is exported by as_btstrp.dll This is meant to be used by aircraft Flight Management Computers a way to get "live" (or forecast) weather information at a specified way point at various flying altitudes. By design it only contains information that may be useful for such functionality as winds, pressure and temperature and not for example precipitation or other information. Here's the declaration of the function:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    bool GetAtmosphere(double lat, double lon, unsigned time_offset, WxData* data, unsigned data_size );
    Parameters:
    - lat, lon: The latitude and longitude in degrees of the waypoint
    - time_offset: The time offset (in seconds) from current base ACTIVE SKY active time. For example if this has value 240*60 (and ACTIVE SKY is in live real time mode), forecast weather conditions at the specified way point 4 hours from now are requested
    - data is an array of WxData structs with a length data_size. The WxData definition is :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    struct WxData
    {
    int AltFt; // (In) The requested altitude (MSL in feet)
    double Pressure; // (Out) The returned pressure (in hectoPascals)
    double Temperature; // (Out) The returned temperature (in Celsius)
    double WindDirection; // (Out) The returned wind direction (in degrees)
    double WindSpeed; // (Out) The returned wind speed (in knots)
    };
    The allocation of the memory (and memory management) for this array is the responsibility of the caller. The caller sets the AltFt value for each instance of WxData and then once the function returns, the values for temperature, winds and pressure will be populated at the specified fields.
    Example:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    double lat = 40.520843;
    double lon = 22.971601; // The lat/lon of LGTS airport
    unsigned time_offset = 0; // We need current data (no forecast)
    unsigned data_size = 2; // We need data for 2 altitudes
    WxData* data = new WxData[data_size];
    data[0].AltFt = 6000;
    data[1].AltFt = 34000;
    if (GetAtmosphere(lat, lon, time_offset, data, data_size))
    {
    for (int i = 0;i < data_size;i++)
    {
    // data[i].AltFt) should be 6000 and 34000
    // data[i].Pressure the ambient pressure at 6000 and 34000 ft
    // data[i].WindDirection) the wind direction at 6000 and 34000 ft
    // data[i].WindSpeed) the wind speed at 6000 and 34000 ft
    // data[i].Temperature) the temperature at 6000 and 34000 ft
    }
    }
    else
    LogMessage(TEXT("ExternalFailed"));
    delete[] data;
    Très novice en matière d'API, surtout quand les exemple sont en C++, comment appeler la fonction de la dll en lui fournissant 1 seule altitude de 10000 ft en Delphi?

    Merci de votre aide

    Cordialement
    Pierre

  9. #9
    Expert éminent sénior
    Avatar de Paul TOTH
    Homme Profil pro
    Freelance
    Inscrit en
    Novembre 2002
    Messages
    8 964
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Freelance
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2002
    Messages : 8 964
    Points : 28 430
    Points
    28 430
    Par défaut
    en plus de ce que je dis plus haut, unsigned est un Cardinal et non un Byte, pour le reste ça m'a l'air ok...que donne l'appel à la fonction ? une erreur, des données incorrectes ?
    Developpez.com: Mes articles, forum FlashPascal
    Entreprise: Execute SARL
    Le Store Excute Store

  10. #10
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2003
    Messages
    439
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2003
    Messages : 439
    Points : 161
    Points
    161
    Par défaut
    Dois-je faire:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    if GetAtmosphere(WxLat, WxLon, WxTime_Shift ,@WxData[10000], WxDataSize) then
    Pour renseigner l'altitude?

    J'ai essayé :
    Sans succès, erreur à la compilation.

    Cordialement
    Pierre

  11. #11
    Rédacteur/Modérateur

    Avatar de SergioMaster
    Homme Profil pro
    Développeur informatique retraité
    Inscrit en
    Janvier 2007
    Messages
    15 029
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 67
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur informatique retraité
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2007
    Messages : 15 029
    Points : 40 928
    Points
    40 928
    Billets dans le blog
    62
    Par défaut
    Bonjour,

    rapidement, ligne 20:
    j'aurais plutôt utilisé
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
      WxDataSize:= SizeOf(WxData);
    MVP Embarcadero
    Delphi installés : D3,D7,D2010,XE4,XE7,D10 (Rio, Sidney), D11 (Alexandria), D12 (Athènes)
    SGBD : Firebird 2.5, 3, SQLite
    générateurs États : FastReport, Rave, QuickReport
    OS : Window Vista, Windows 10, Windows 11, Ubuntu, Androïd

  12. #12
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2003
    Messages
    439
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2003
    Messages : 439
    Points : 161
    Points
    161
    Par défaut
    Merci,

    Je suis plutôt perdu...

    WxData est un tableau dans l'API, dont la taille est déterminée par WxDataSize qui donne le nombre d'altitudes souhaitées.

    Merci par avance
    Pierre

  13. #13
    Rédacteur/Modérateur

    Avatar de SergioMaster
    Homme Profil pro
    Développeur informatique retraité
    Inscrit en
    Janvier 2007
    Messages
    15 029
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 67
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur informatique retraité
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2007
    Messages : 15 029
    Points : 40 928
    Points
    40 928
    Billets dans le blog
    62
    Par défaut
    Autant pour moi, en relisant l'api je vois que WxDataSize est en fait le nombre d'éléments du tableau le nom portait à confusion
    donc WxDataSize:= 1; semble correct
    MVP Embarcadero
    Delphi installés : D3,D7,D2010,XE4,XE7,D10 (Rio, Sidney), D11 (Alexandria), D12 (Athènes)
    SGBD : Firebird 2.5, 3, SQLite
    générateurs États : FastReport, Rave, QuickReport
    OS : Window Vista, Windows 10, Windows 11, Ubuntu, Androïd

  14. #14
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2003
    Messages
    439
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2003
    Messages : 439
    Points : 161
    Points
    161
    Par défaut
    Merci beaucoup,

    Comment dimensionner le tableau dans l'appel de fonction SVP?

    Cordialement
    Pierre

  15. #15
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2003
    Messages
    439
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2003
    Messages : 439
    Points : 161
    Points
    161
    Par défaut
    Voici le dernier code utilisé:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    Procedure LoadAsWx;
    var
      WxLat: Double;
      WxLon: Double;
      WxTime_Shift: Cardinal;
      WxData: array of TWxData;
      WxDataSize: Cardinal;
      HandleDLL: THandle;
      GetAtmosphere: function(Lat: Double; Lon: Double; Time_Offset: Byte;
                              Data: Array of TWxData; Data_Size: Byte): Boolean;
                              stdcall;
    begin
      GetAtmosphere:= nil;
      WxDataSize:= 1;
      SetLength(WxData,WxDataSize);
      HandleDLL:= LoadLibrary(pWideChar('D:\Program Files (x86)\HiFi\AS16_P3D\as_srv\as_btstrp.dll'));
      if HandleDLL = 0 then Exit;
      GetAtmosphere:= GetProcAddress(HandleDLL, pAnsiChar('GetAtmosphere'));
      WxLat:= 40.520843;
      WxLon:= 22.971601;
      WxTime_Shift:= 0;
      WxData[0].AltFt:= 10000;
      if GetAtmosphere(WxLat, WxLon, WxTime_Shift ,WxData, WxDataSize) then
      begin
        ShowMessage(FloatToStr(WxData[0].Pressure));
      end;
    end;
    GetAtmosphere renvoie False.
    Le chemin de la dll est correct.

    Une idée?

    Coredialement
    Pierre

  16. #16
    Expert éminent sénior
    Avatar de ShaiLeTroll
    Homme Profil pro
    Développeur C++\Delphi
    Inscrit en
    Juillet 2006
    Messages
    13 447
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Développeur C++\Delphi
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2006
    Messages : 13 447
    Points : 24 844
    Points
    24 844
    Par défaut
    Avec toutes ces interventions, tu sembles complètement perdu !
    Pourtant Paul TOTH avait déjà tout écrit !
    Reste le bool qui n'est pas si simple en C++ qu'en Delphi, je mise sur 1 octet donc ByteBool
    sur une API, il vaut mieux utiliser un type car unsigned dont la longueur est bien stable que le type bool.
    En Delphi, ByteBool et Boolean, c'est pareil mais avec une API mieux vaut être explicite

    Code c++ : Sélectionner tout - Visualiser dans une fenêtre à part
    bool GetAtmosphere(double lat, double lon, unsigned time_offset, WxData* data, unsigned data_size );

    en premier le type record et son pointer !
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    type
      PWxData = ^TWxData; // c'est l'équivalent du WxData* !
      TWxData = record // vu les types int / double, l'alignement ne devrait pas posé problème, a vérifier quand même
        AltFt: Integer;// Out
        Pressure: Double;//In
        Temperature: Double;//In
        WindDirection: Double;//In
        WindSpeed:Double;//In
      end;
    et l'appel

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    var
      WxLat: Double;
      WxLon: Double;
      WxTime_Shift: Cardinal;
      WxData: array of TWxData;
      WxDataSize: Cardinal;
      HandleDLL: THandle;
      GetAtmosphere: function(Lat: Double; Lon: Double; Time_Offset: Cardinal; Data: PWxData; Data_Size: Cardinal): ByteBool; stdcall;
    begin
      WxDataSize:= 1;
      SetLength(WxData,WxDataSize);
     
      HandleDLL:= LoadLibrary(pWideChar('D:\Program Files (x86)\HiFi\AS16_P3D\as_srv\as_btstrp.dll'));
      if HandleDLL = 0 then 
        Exit;
     
      @GetAtmosphere := GetProcAddress(HandleDLL, pAnsiChar('GetAtmosphere'));
      if not Assigned(GetAtmosphere) then 
        Exit;
     
      WxLat:= 40.520843;
      WxLon:= 22.971601;
      WxTime_Shift:= 0;
      WxData[0].AltFt:= 10000;
     
      if GetAtmosphere(WxLat, WxLon, WxTime_Shift, @WxData[0], WxDataSize) then
        ShowMessage(FloatToStr(WxData[0].Pressure));
    end;
    Aide via F1 - FAQ - Guide du développeur Delphi devant un problème - Pensez-y !
    Attention Troll Méchant !
    "Quand un homme a faim, mieux vaut lui apprendre à pêcher que de lui donner un poisson" Confucius
    Mieux vaut se taire et paraître idiot, Que l'ouvrir et de le confirmer !
    L'ignorance n'excuse pas la médiocrité !

    L'expérience, c'est le nom que chacun donne à ses erreurs. (Oscar Wilde)
    Il faut avoir le courage de se tromper et d'apprendre de ses erreurs

  17. #17
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2003
    Messages
    439
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2003
    Messages : 439
    Points : 161
    Points
    161
    Par défaut
    Merci, ça me semble plus clair à présent, mais la fonction GetAtmosphere renvoie toujours False.

    Cordialement
    Pierre

  18. #18
    Expert éminent sénior
    Avatar de ShaiLeTroll
    Homme Profil pro
    Développeur C++\Delphi
    Inscrit en
    Juillet 2006
    Messages
    13 447
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Développeur C++\Delphi
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2006
    Messages : 13 447
    Points : 24 844
    Points
    24 844
    Par défaut
    Tente de remplacer stdcall par cdecl
    Après, je sèche totalement
    Aide via F1 - FAQ - Guide du développeur Delphi devant un problème - Pensez-y !
    Attention Troll Méchant !
    "Quand un homme a faim, mieux vaut lui apprendre à pêcher que de lui donner un poisson" Confucius
    Mieux vaut se taire et paraître idiot, Que l'ouvrir et de le confirmer !
    L'ignorance n'excuse pas la médiocrité !

    L'expérience, c'est le nom que chacun donne à ses erreurs. (Oscar Wilde)
    Il faut avoir le courage de se tromper et d'apprendre de ses erreurs

  19. #19
    Membre habitué
    Profil pro
    Inscrit en
    Avril 2003
    Messages
    439
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2003
    Messages : 439
    Points : 161
    Points
    161
    Par défaut
    Merci Shai, Pas de changement, GetAtmosphere est toujours à False.

    Peut-être d'autres pistes?

    Cordialement
    Pierre

  20. #20
    Expert éminent sénior
    Avatar de ShaiLeTroll
    Homme Profil pro
    Développeur C++\Delphi
    Inscrit en
    Juillet 2006
    Messages
    13 447
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Développeur C++\Delphi
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2006
    Messages : 13 447
    Points : 24 844
    Points
    24 844
    Par défaut
    Regarde la doc, et cherche une fonction genre "Initialize", "Connect" ou "StartUp", certaines API fonctionne ainsi
    Si pas de fonction d'init, reste plus que contacter l'auteur pour qu'il te donne plus de précision !
    Aide via F1 - FAQ - Guide du développeur Delphi devant un problème - Pensez-y !
    Attention Troll Méchant !
    "Quand un homme a faim, mieux vaut lui apprendre à pêcher que de lui donner un poisson" Confucius
    Mieux vaut se taire et paraître idiot, Que l'ouvrir et de le confirmer !
    L'ignorance n'excuse pas la médiocrité !

    L'expérience, c'est le nom que chacun donne à ses erreurs. (Oscar Wilde)
    Il faut avoir le courage de se tromper et d'apprendre de ses erreurs

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. Appel de fonction d'une DLL
    Par -Mod- dans le forum x86 32-bits / 64-bits
    Réponses: 17
    Dernier message: 31/12/2007, 19h13
  2. Appel de fonctions d'une DLL C++ depuis Java
    Par max_rossito dans le forum API standards et tierces
    Réponses: 1
    Dernier message: 11/01/2007, 22h54
  3. pb d'appel aux fonctions d'une DLL (visual C++ 6.0)
    Par touti35 dans le forum Visual C++
    Réponses: 4
    Dernier message: 12/12/2006, 09h37
  4. Appel de fonction d'une DLL en TANSAC SQL
    Par sylvain114d dans le forum MS SQL Server
    Réponses: 3
    Dernier message: 19/01/2006, 10h21
  5. Appel aux fonctions d'une DLL externe ??
    Par Fbartolo dans le forum Access
    Réponses: 7
    Dernier message: 21/11/2005, 17h54

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo