From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problème de création d'une FonctionPanel avec la librairie de gestion des fichiers

Bonjour,

 

Etape1 : Création du projet

Je suis en train de créer une librairie bas niveau permettant de personnaliser les fonction de gestion de fichier (ajout d'une gestion les défauts en bas niveau).

J'utilise les fonctions fopen, fclose, ... de la librairie ANSI_C.

      => La compilation et l'utilisation fonctionne très bien.

 

Etape2 : Création du .FP

La création des fonctions panels fonctionne également très bien en local dans le projet.

Afin de pouvoir réutiliser cette fonction panel au niveau supérieur, je l'ai incluse à la compilation (via "Type Library").

      => Problème 1 : Le type FILE déclaré dans le header "stdio.h" n'est pas au bon format (les structures doivent être en typedef...).

 

ACTUEL :                                                                                              MODIFIER

struct _mode {                                                                                        typedef struct {

    unsigned int read:1;
    unsigned int write:1;
    unsigned int append:1;
    unsigned int binary:1;
    unsigned int create:1;
    unsigned int truncate:1;
    unsigned int fdopen:1;
    unsigned int reserved:25;
};                                                                                                           }  _mode;

 

struct _state {                                                                                        typedef struct {
    unsigned int bufalloc:1;
    unsigned int filealloc:1;
    unsigned int eof:1;
    unsigned int error:1;
    unsigned int linebuf:1;
    unsigned int nobuf:1;
    unsigned int wasread:1;
    unsigned int waswritten:1;
    unsigned int InUse:1;
    unsigned int reserved:23;
};                                                                                                           }  _state;


typedef struct {
    struct _mode mode;                                                                             _mode mode;
    struct _state state;                                                                              _state state;
    int   handle;
    unsigned char *buffer;
    unsigned char *bufferEnd;
    unsigned char *next;
    unsigned char *readEnd;
    unsigned char *writeEnd;
    unsigned char *readEndSave;
    unsigned char pushedBack[6];
    char numPushedBack;
    unsigned char defaultBuf;
    unsigned char *tmpname;
    void *lock;
    int   consoleHandle;    // Console handle for host stdio
} FILE;

 

CETTE MODIFICATION EST VALABLE POUR UN ESSAI MAIS N'EST PAS ENVISAGEABLE POUR UNE LIVRAISON DE MES LIBRAIRIES AUX AUTRES USINES DU GROUPE...

 

      => Problème 2 : Après modification du "stdio.h", la compilation fonctionne avec les erreurs suivantes et la fonction panel n'est toujours pas visible au niveau supérieur. 

 

9 Project link errors
 Error generating type library.  Midl.exe failed while compiling the odl file used to create the type library.
 Note: The error indicates that the odl file has unknown types. This error is possible when
 functions with non-standard types are exported using the export qualifier method from files in
 release configuration that have not been recompiled during the build process. You can mark all
 files for recompilation and repeat the build. To avoid this situation, it is recommended that
 you export these functions using the include file method.
 Use the generated odl file "c:\TestSources\ESSAI IMBRICATION\1-DriverFunctions.odl" with the command line:
 c:\PROGRA~2\NATION~1\cvi2010\sdk\bin\midl.exe "c:\TestSources\ESSAI IMBRICATION\1-DriverFunctions.odl" /win32 /mktyplib203 /tlb "1-DriverFunctions.tlb" /Ic:\PROGRA~2\NATION~1\cvi2010\sdk\include /cpp_cmd c:\PROGRA~2\NATION~1\cvi2010\bin\preprocessor.exe
 to see what errors midl.exe reported.

 

 

      => Question 1 : Comment pourrais-je ajouter FILE a la liste des types de la fonction panel (pour le paramètre d'entrée de l'une de mes fonctions) ?

 

      => Question 2 : J'ai fait l'essai avec "inifile.fp". Pour tout inclure à ma librairie, il me faut inclure le "inifile.obj" à la compilation via "LoadExternalModule". Il doit me manquer des étapes ?

 

 

 

                                                          Merci et bonne soirée et bon WE

 

 

                                                                                                                 Guillaume

0 Kudos
Message 1 of 2
(3,391 Views)

Hello GuillaumePeigne75,

 

You're in the English section of the forums so please post in English if you expect to be helped. Otherwise, you can also post here : Discussions au sujet des autres produits NI if you prefer.

 

Don't hesitate to rephrase your post if your problematic has changed or evolved.

 

Regards,

Jérémy C.
NI France

0 Kudos
Message 2 of 2
(3,372 Views)