Partage
  • Partager sur Facebook
  • Partager sur Twitter

Problème de DLL

Passage de fonction d'une dll C/C++ vers un programme C#

Sujet résolu
    12 avril 2021 à 9:42:08

    D'accord, j'ai donc supprimer l'étape 4 et mis en commentaire l'#include du .h.

    J'ai également mis le débogage en Release, x86.

    J'obtiens 21 Erreurs et 6 Warnings.

    Toujours le avertissements C4793 et C4067: jeton inattendus après directive du préprocesseur - saut de ligne attendu, dans le fichier .cpp (ligne 7)

    et en erreur j'ai:

    LNK1120 20 externes non résolus dans le fichier WrapperCpp.dll
    LNK2028 (x8) dans le fichier WrapperCpp.obj
    jeton non résolu (0A000547)"public thiscall...
    LNK2019 (x8) même fichier
    symbole externe non résolu...
    LNK2001 (x2) idem
    symbole externe non résolu...

    Je vais tous revérifier

    (Désolé d'encore modifié)

    Je suis passé en Release x64 et j'arrive a compiler :)

    -
    Edité par VincentL10 12 avril 2021 à 10:27:05

    • Partager sur Facebook
    • Partager sur Twitter
      12 avril 2021 à 12:23:38

      Faudrait regardez de plus près les warning "C4067", ça peut être des petits problèmes de configurations et des nids à emmerdes.

      Pouvez-vous poster une des lignes qui déclenche ce warning ?

      Pour les warning "C4793", ça peut être aussi des petits problèmes de configurations (genre du code qui n'a pas être pris en compte).

      Donc, pouvez-vous poster les lignes qui déclenche ce warning, mais avec les lignes avant et après aussi, genre tout ce qui est dans un #if defined.../#endif ?

      Des erreurs en LNK, c'est que ça compile, reste plus l'édition de lien. On y est presque. ;)

      Et à la tête des erreurs, c'est plus du côté de votre wrapper qu'il y a un problème.

      Pouvez-vous poster le .h et le .cpp de votre wrapper ?

      • Partager sur Facebook
      • Partager sur Twitter
      Je recherche un CDI/CDD/mission freelance comme Architecte Logiciel/ Expert Technique sur technologies Microsoft.
        12 avril 2021 à 12:56:51

        Alors le .cpp :

        #pragma once
        
        //Interne
        #include "pch.h"
        #include "WrapperCpp.h"
        
        //GC
        #include <_GCVersion.h>
        #include <GC.h>
        #include <_GCFwd.h>
        #include <GCVersion.h>
        
        int WrapperCpp::_GCVersion::Major()
        {
            _Major = GC_VERSION_MAJOR;
        }

        Pour le .h :

        #pragma once
        
        //Include GC
        //#include <GC.h>
        
        namespace WrapperCpp {
           public ref class _GCVersion
           {
           public:
              int Major();
              int _Major = 0;
           };
        }

        Pour les warnings :

        C4793 (x2)'GC_3_2::ExceptionReporter<GC_3_2::AccessException>::Report': fonction compilé en tant que code natif : WrapperCpp gcexeption.h 185
        LNK4272 (x2) type d'ordinateur bibliothèque 'x64' en conflit avec le type d'ordinateur cilbe 'x86' WrapperCpp GCBase_MD_VC141_v3_2.lib 1
        
        Idem pour le GApi_MD_VC141_v3_2.lib

        Voici une des erreurs :

        LNK2019 symbole extern non résolu "public:__thiscall GC_3_2::gcstring::gcstring(char const*)" (??0gcstring@GC_3_2@@$$FQAE@PDB@Z) référencé dans la fonction "private: void __thiscall GApi_3_2::CNodeMapRefT<class GApi_3_2::CGeneric_XMLLoaderParams>::Release(void)"("?Release@?$CNodeMApRefT@VCGeneric_XMLLoaderParams@Params@GApi_3_2@@@GApi_3_2@@$$FAAEXXZ) WrapperCpp WrapperCpp.obj 1

        Je suis repassé en Release, x86

        Ceci est la ligne 185 du gcexception.h :

        E Report(const char* pFormat, ...)
        {                                         (<- ligne de l'erreur)
           char pBuffer[256];
           va_list vap;
           va_start(vap, pFormat);
        
        ...




        -
        Edité par VincentL10 12 avril 2021 à 12:59:29

        • Partager sur Facebook
        • Partager sur Twitter
          12 avril 2021 à 18:35:39

          Comme déjà indiqué, n'inclure que <GC.h>.

          Les <xGC_Version.xxx>, c'est pour sa tambouille interne pour que vous n'ayez pas à faire l'étape 4.

          Donc, ne les incluez pas, SVP.

          <_GCFwd.h>, c'est pour de la tambouille pour les fichiers d'en-tête, ne l'incluez pas, au moins pour l'instant.

          Les trucs dans <_GC_Version>, ça fait pas vraiment parti de l'API.

          Comme je l'ai déjà écrit, essayez de wrapper une vrai classe/API et pas des trucs qui n'ont rien avoir avec.

          Wrapper la classe "GENAPI_NAMESPACE.CLock" ou une classe qui implémente l'une des interfaces défini dans l'espace de noms "GENAPI_NAMESPACE" (cf. le contenu du fichier <_GCFwd.h>) serait bien plus pertinent. Essayez de choisir une classe qui a des bonnes chances d'être utilisée pour votre projet en C#. Il doit avoir une documentation qui doit présenter les différentes interfaces.

          Faire un arbre d'héritage des différentes interfaces/structures/classes permet souvent de clarifier des choses. Faire un arbre de composition peut aussi être utile, mais c'est plus long.

          >C4793

          Si on avait le contenu du fichier "gcexeption.h" ou au moins les lignes proches de la ligne 185, ça serait quand même plus simple pour vous aider. :-°

          Sinon, pour éviter ce genre de mélange :

          https://stackoverflow.com/questions/18302784/including-headers-from-an-unmanaged-c-code-inside-c-cli-code

          En claire, remplacer au début de votre Wrapper.cpp :

          #include <GC.h>

          par 

          #pragma managed(push, off)
          #include <GC.h>
          #pragma managed(pop)

          Ca permet de lever les ambiguïtés entre du "code/déclaration" C++ natifs des choses C++/CLI.

          EDIT : effectivement, vous nous donnez la ligne 185 de "gcexeption.h", et le "E" en "convention d'appel + type de retour" de la fonction "Report" me fait tiquer. C'est le genre de truc qui peut être mal interprété par le pré-processeur et le compilateur si les .h de la librairie ne sont pas correctement "blindés". L'ajout des "#pragma managed push/pop" devrait "blinder" les .h à leur place.

          >LNK4272

          Ok, vous compilez pour du 64bits (x64 dans le message d'erreur) mais cette Lib/Dll a été compilée pour s'exécuter en 32 bits (le x86 dans le message d'erreur, cherchez pas la logique, c'est une longue histoire). Il est impossible de faire tourner du code 32bits du bibliothèque dans un exécutable 64 bits.

          Il faudra donc cibler la plateforme "x86" et non plus "x64" dans les propriétés du projet C++/CLI du wrapper.

          Cela aura aussi un impact dans la configuration de votre programme C#, mais on verra ça après.
          (Du 32 bits en 2021, sérieux ?!?, faudrait qu'ils sortent d'hibernation de temps en temps)

          >Je suis repassé en Release, x86

          Ce devrait donc régler le problème des "LNK4272", non ?

          >LNK2019

          C'est le genre de truc qui peut arriver si le compilateur C++/CLI interprète différemment la signature de la fonction "GC_3_2::gcstring::gcstring" contenue dans les fichiers d'en-tête de la bibliothèque et le compilateur C++ natif qui a généré le .lib. Avec l'ajout des "#pragma managed push/pop" (cf. l'EDIT ci-avant), ça devrait réduire le risque de divergence d'interprétation.

          Après les quelques modifications conseillées, donnez-nous les messages d'erreurs et le .h contenant la déclaration de l'interface/structure/classe que vous avez choisie de wrapper.

          • Partager sur Facebook
          • Partager sur Twitter
          Je recherche un CDI/CDD/mission freelance comme Architecte Logiciel/ Expert Technique sur technologies Microsoft.
            13 avril 2021 à 9:15:32

            Voici le Wrapper.cpp :

            //Interne
            #include "pch.h"
            #include "WrapperCpp.h"
            
            #pragma managed (push, off)
            
            //Include GC	
            #include <GC.h>
            
            #pragma managed(pop)

            Voici les erreurs et avertissements :

            Gravité	Code	Description	Projet	Fichier	Ligne	État de la suppression
            Erreur	LNK2019	symbole externe non résolu "public: __thiscall GenICam_3_3::gcstring::gcstring(void)" (??0gcstring@GenICam_3_3@@QAE@XZ) référencé dans la fonction "public: __thiscall GenApi_3_3::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams>::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams>(class GenApi_3_3::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams> const &)" (??0?$CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi_3_3@@@GenApi_3_3@@QAE@ABV01@@Z)	WrapperCpp	WrapperCpp.obj	1	
            Erreur	LNK2019	symbole externe non résolu "public: class GenICam_3_3::gcstring & __thiscall GenICam_3_3::gcstring::operator=(class GenICam_3_3::gcstring const &)" (??4gcstring@GenICam_3_3@@QAEAAV01@ABV01@@Z) référencé dans la fonction "public: __thiscall GenApi_3_3::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams>::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams>(class GenApi_3_3::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams> const &)" (??0?$CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi_3_3@@@GenApi_3_3@@QAE@ABV01@@Z)	WrapperCpp	WrapperCpp.obj	1	
            Erreur	LNK2019	symbole externe non résolu "public: virtual __thiscall GenICam_3_3::gcstring::~gcstring(void)" (??1gcstring@GenICam_3_3@@UAE@XZ) référencé dans la fonction __unwindfunclet$??0?$CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi_3_3@@@GenApi_3_3@@QAE@ABV01@@Z$0	WrapperCpp	WrapperCpp.obj	1	
            Erreur	LNK2019	symbole externe non résolu "public: __thiscall GenApi_3_3::CNodeMapFactory::CNodeMapFactory(void)" (??0CNodeMapFactory@GenApi_3_3@@QAE@XZ) référencé dans la fonction "public: virtual void __thiscall GenApi_3_3::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams>::_GetSupportedSchemaVersions(class GenICam_3_3::gcstring_vector &)const " (?_GetSupportedSchemaVersions@?$CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi_3_3@@@GenApi_3_3@@UBEXAAVgcstring_vector@GenICam_3_3@@@Z)	WrapperCpp	WrapperCpp.obj	1	
            Erreur	LNK2019	symbole externe non résolu "public: void __thiscall GenApi_3_3::CNodeMapFactory::GetSupportedSchemaVersions(class GenICam_3_3::gcstring_vector &)const " (?GetSupportedSchemaVersions@CNodeMapFactory@GenApi_3_3@@QBEXAAVgcstring_vector@GenICam_3_3@@@Z) référencé dans la fonction "public: virtual void __thiscall GenApi_3_3::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams>::_GetSupportedSchemaVersions(class GenICam_3_3::gcstring_vector &)const " (?_GetSupportedSchemaVersions@?$CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi_3_3@@@GenApi_3_3@@UBEXAAVgcstring_vector@GenICam_3_3@@@Z)	WrapperCpp	WrapperCpp.obj	1	
            Erreur	LNK2019	symbole externe non résolu "public: virtual __thiscall GenApi_3_3::CNodeMapFactory::~CNodeMapFactory(void)" (??1CNodeMapFactory@GenApi_3_3@@UAE@XZ) référencé dans la fonction "public: virtual void __thiscall GenApi_3_3::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams>::_GetSupportedSchemaVersions(class GenICam_3_3::gcstring_vector &)const " (?_GetSupportedSchemaVersions@?$CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi_3_3@@@GenApi_3_3@@UBEXAAVgcstring_vector@GenICam_3_3@@@Z)	WrapperCpp	WrapperCpp.obj	1	
            Erreur	LNK2001	symbole externe non résolu "public: virtual __thiscall GenICam_3_3::AccessException::~AccessException(void)" (??1AccessException@GenICam_3_3@@UAE@XZ)	WrapperCpp	WrapperCpp.obj	1	
            Erreur	LNK2001	symbole externe non résolu "public: __thiscall GenICam_3_3::AccessException::AccessException(class GenICam_3_3::AccessException const &)" (??0AccessException@GenICam_3_3@@QAE@ABV01@@Z)	WrapperCpp	WrapperCpp.obj	1	
            Erreur	LNK2001	symbole externe non résolu "public: __thiscall GenICam_3_3::GenericException::GenericException(class GenICam_3_3::GenericException const &)" (??0GenericException@GenICam_3_3@@QAE@ABV01@@Z)	WrapperCpp	WrapperCpp.obj	1	
            Erreur	LNK2019	symbole externe non résolu "public: __thiscall GenICam_3_3::gcstring::gcstring(char const *)" (??0gcstring@GenICam_3_3@@QAE@PBD@Z) référencé dans la fonction "private: void __thiscall GenApi_3_3::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams>::Release(void)" (?Release@?$CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi_3_3@@@GenApi_3_3@@AAEXXZ)	WrapperCpp	WrapperCpp.obj	1	
            Erreur	LNK2019	symbole externe non résolu "public: __thiscall GenICam_3_3::AccessException::AccessException(char const *,char const *,int,char const *)" (??0AccessException@GenICam_3_3@@QAE@PBD0H0@Z) référencé dans la fonction "public: class GenICam_3_3::AccessException __cdecl GenICam_3_3::ExceptionReporter<class GenICam_3_3::AccessException>::Report(char const *,...)" (?Report@?$ExceptionReporter@VAccessException@GenICam_3_3@@@GenICam_3_3@@QAA?AVAccessException@2@PBDZZ)	WrapperCpp	WrapperCpp.obj	1	
            Avertissement	LNK4272	type d'ordinateur bibliothèque 'x64' en conflit avec le type d'ordinateur cible 'x86'	WrapperCpp	GCBase_MD_VC141_v3_3.lib	1	
            Avertissement	LNK4272	type d'ordinateur bibliothèque 'x64' en conflit avec le type d'ordinateur cible 'x86'	WrapperCpp	GenApi_MD_VC141_v3_3.lib	1	
            Erreur	LNK1120	11 externes non résolus	WrapperCpp	WrapperCpp.dll	1	
            

            En Release, x86

            P.S : Une nouvelle version est sortie. Mais aussi, j'ai trouvé des .h qui ne font pas partie de l'arborescence et qui serait intéressant.

            Entre autre le GTL :

             *  \par Version history
             *  \li Version 0.1.0   First official version from the meeting in Pilsen
             *  \li Version 0.1.1   rst (SI) 0.4.160
             *                      - added _E_INTERFACE_INFO_CMD_LIST_T_ enum name
             *                      - added _E_DEVICE_ACCCESS_STATUS_TYPE_T_ to be used
             *                      with the /a IFGetDeviceInfo and DevGetInfo
             *                      - rename of the enum value DEVICE_INFO_ACCESSMODE to
             *                      DEVICE_INFO_ACCESS_STATUS which now refers to
             *                      _E_DEVICE_ACCCESS_STATUS_TYPE_T_
             *                      - added Timeout parameter to update interface list and
             *                      device list.
             *  \li Version 0.1.2   - change datatype of timeout parameter of
            #ifndef GC_TLI_CLIENT_H_
            #define GC_TLI_CLIENT_H_ 1
            
            #ifndef GC_USER_DEFINED_TYPES
            /* The types should be the same as defined in GCTypes.h from GenApi. But in
             * case you do not have this header the necessary types are defined here. */
            #  if defined(_WIN32)
            #    if defined(_MSC_VER) && _MSC_VER >= 1600 /* VS2010 provides stdint.h */
            #      include <stdint.h>
            #    elif !defined _STDINT_H && !defined _STDINT
                   /* stdint.h is usually not available under Windows */
                   typedef unsigned char uint8_t;
                   typedef __int32 int32_t;
                   typedef unsigned __int32 uint32_t;
                   typedef unsigned __int64 uint64_t;
            #    endif
            #  else
            #    include <stdint.h>
            #  endif
            
            #  ifdef __cplusplus
                 typedef bool bool8_t;
            #  else
                 typedef uint8_t bool8_t;
            #  endif
            #endif /* GC_DEFINE_TYPES */
            
            #include <stddef.h>
            
            
            /* Function declaration modifiers */
            #if defined (_WIN32)
            #  ifndef GCTLI_NO_DECLSPEC_STATEMENTS
            #    ifdef GCTLIDLL
            #      define GC_IMPORT_EXPORT __declspec(dllexport)
            #    else
            #      define GC_IMPORT_EXPORT __declspec(dllimport)
            #    endif
            #  else
            #      define GC_IMPORT_EXPORT
            #  endif /* #  ifndef GCTLI_NO_DECLSPEC_STATEMENTS */
            #  if defined (_M_IX86) || defined (__i386__)
            #    define GC_CALLTYPE __stdcall
            #  else
            #    define GC_CALLTYPE /* default */
            #  endif
            #  ifndef EXTERN_C
            #    define EXTERN_C extern "C"
            #  endif
            
            #elif defined (__GNUC__) && (__GNUC__ >= 4) && (defined (__linux__) || defined (__APPLE__))
            #  define GC_IMPORT_EXPORT __attribute__((visibility("default")))
            #  if defined (__i386__)
            #    define GC_CALLTYPE __attribute__((stdcall))
            #  else
            #    define GC_CALLTYPE /* default */
            #  endif
            #  ifndef EXTERN_C
            #    define EXTERN_C extern "C"
            #  endif
            
            #else
            #  error Unknown platform, file needs adaption
            #endif
            
            #ifdef __cplusplus
            extern "C" {
              namespace GenTL {
            #endif
            
                /* Errors */
                enum GC_ERROR_LIST
                {
                  GC_ERR_SUCCESS             = 0,
                  GC_ERR_ERROR               = -1001,
                  GC_ERR_NOT_INITIALIZED     = -1002,
                  GC_ERR_NOT_IMPLEMENTED     = -1003,
                  GC_ERR_RESOURCE_IN_USE     = -1004,
                  GC_ERR_ACCESS_DENIED       = -1005,
                  GC_ERR_INVALID_HANDLE      = -1006,
                  GC_ERR_INVALID_ID          = -1007,
                  GC_ERR_NO_DATA             = -1008,
                  GC_ERR_INVALID_PARAMETER   = -1009,
                  GC_ERR_IO                  = -1010,
                  GC_ERR_TIMEOUT             = -1011,
                  GC_ERR_ABORT               = -1012, /* GenTL v1.1 */
                  GC_ERR_INVALID_BUFFER      = -1013, /* GenTL v1.1 */
                  GC_ERR_NOT_AVAILABLE       = -1014, /* GenTL v1.2 */
                  GC_ERR_INVALID_ADDRESS     = -1015, /* GenTL v1.3 */
                  GC_ERR_BUFFER_TOO_SMALL    = -1016, /* GenTL v1.4 */
                  GC_ERR_INVALID_INDEX       = -1017, /* GenTL v1.4 */
                  GC_ERR_PARSING_CHUNK_DATA  = -1018, /* GenTL v1.4 */
                  GC_ERR_INVALID_VALUE       = -1019, /* GenTL v1.4 */
                  GC_ERR_RESOURCE_EXHAUSTED  = -1020, /* GenTL v1.4 */
                  GC_ERR_OUT_OF_MEMORY       = -1021, /* GenTL v1.4 */
                  GC_ERR_BUSY                = -1022, /* GenTL v1.5 */
                  GC_ERR_AMBIGUOUS           = -1023, /* GenTL v1.6 */
            
                  GC_ERR_CUSTOM_ID           = -10000
                };
                typedef int32_t GC_ERROR;
            
            #   ifndef GC_GENTL_HEADER_VERSION
            
            #     define GenTLMajorVersion       1 /* defines the major version of the GenICam GenTL standard version this header is based on */
            #     define GenTLMinorVersion       6 /* defines the minor version of the GenICam GenTL standard version this header is based on */
            #     define GenTLSubMinorVersion    0 /* defines the sub minor version of the GenICam GenTL standard version this header is based on */
            
            #     define GC_GENTL_HEADER_VERSION_CODE(major,minor,subminor) (((major)<<24)+((minor)<<16)+(subminor))
            #     define GC_GENTL_HEADER_VERSION GC_GENTL_HEADER_VERSION_CODE(GenTLMajorVersion,GenTLMinorVersion,GenTLSubMinorVersion)
            
            #   endif /* GC_GENTL_HEADER_VERSION */
            
            #   ifndef GC_GENTL_DONT_USE_TYPE_DEFINITIONS
            #     define TLTypeMixedName           "Mixed"    /* Type to use for several supported technologies */
            #     define TLTypeCustomName          "Custom"   /* Type to use for custom technologies */
            #     define TLTypeGEVName             "GEV"      /* Type to use for GigE Vision technology */
            #     define TLTypeCLName              "CL"       /* Type to use for Camera Link technology */
            #     define TLTypeIIDCName            "IIDC"     /* Type to use for IIDC 1394 technology */
            #     define TLTypeUVCName             "UVC"      /* Type to use for USB video class devices */
            #     define TLTypeCXPName             "CXP"      /* Type to use for CoaXPress, V1.3 */
            #     define TLTypeCLHSName            "CLHS"     /* Type to use for Camera Link HS, V1.3 */
            #     define TLTypeU3VName             "U3V"      /* Type to use for USB3 Vision Standard, V1.4 */
            #     define TLTypeETHERNETName        "Ethernet" /* Type to use for Ethernet devices, V1.3 */
            #     define TLTypePCIName             "PCI"      /* Type to use for PCI/PCIe devices, V1.3 */
            #   endif  /* GC_GENTL_DONT_USE_TYPE_DEFINITIONS */
            
            #   ifndef GC_GENTL_DONT_USE_MODULE_NAMES
            #     define TLSystemModuleName        "TLSystem"     /* Name to identify a system module */
            #     define TLInterfaceModuleName     "TLInterface"  /* Name to identify a interface module */
            #     define TLDeviceModuleName        "TLDevice"     /* Name to identify a device module */
            #     define TLDataStreamModuleName    "TLDataStream" /* Name to identify a data stream module */
            #     define TLBufferModuleName        "TLBuffer"     /* Name to identify a buffer module */
            #     define TLRemoteDeviceModuleName  "Device"       /* Name to identify a remote device module */
            #   endif /* GC_GENTL_DONT_USE_MODULE_NAMES */
            
                /* Handles */
                typedef void *  TL_HANDLE;         /* Transport Layer handle, obtained through the TLOpen */
                typedef void *  IF_HANDLE;         /* Interface handle, obtained through ::TLOpenInterface */
                typedef void *  DEV_HANDLE;        /* Device handle, obtained through the ::IFOpenDevice */
                typedef void *  DS_HANDLE;         /* Handle to an data stream object, obtained through DevOpenDataStream */
                typedef void *  PORT_HANDLE;       /* A Port handle is used to access the register space of a port */
                                /*  a PORT_HANDLE can be one of the following TL_HANDLE, IF_HANDLE, */
                                /*  DEV_HANDLE, handle to a device port, obtained through ::DevGetPort, */
                                /*  DS_HANDLE, BUFFER_HANDLE */
            
                typedef void *  BUFFER_HANDLE;     /* Buffer handle, obtained through the ::DSAnnounceBuffer or related function */
                typedef void *  EVENTSRC_HANDLE;   /* A Event source handle is used to register a OS Event and to retrieve a GenTL event handle */
                                /* a EVENTSRC_HANDLE can be on of the following TL_HANDLE, */
                                /* IF_HANDLE, DEV_HANDLE, DS_HANDLE, BUFFER_HANDLE */
                typedef void *  EVENT_HANDLE;      /* Event handle, obtained through the ::GCRegisterEvent */
            
            #   define GENTL_INVALID_HANDLE  NULL                /* Invalid handle value, V1.4 */ 
            #   define GENTL_INFINITE        0xFFFFFFFFFFFFFFFFULL  /* Infinite value to be used in various function calls, V1.4 */
            
                /* Defines the data type possible for the various Info functions. */
                enum INFO_DATATYPE_LIST
                {
                  INFO_DATATYPE_UNKNOWN     = 0,       /* Unknown data type */
                  INFO_DATATYPE_STRING      = 1,       /* NULL-terminated C string (ASCII encoded). */
                  INFO_DATATYPE_STRINGLIST  = 2,       /* Concatenated INFO_DATATYPE_STRING list. End of list is signaled with an additional NULL. */
                  INFO_DATATYPE_INT16       = 3,       /* Signed 16 bit integer. */
                  INFO_DATATYPE_UINT16      = 4,       /* Unsigned 16 bit integer */
                  INFO_DATATYPE_INT32       = 5,       /* Signed 32 bit integer */
                  INFO_DATATYPE_UINT32      = 6,       /* Unsigned 32 bit integer */
                  INFO_DATATYPE_INT64       = 7,       /* Signed 64 bit integer */
                  INFO_DATATYPE_UINT64      = 8,       /* Unsigned 64 bit integer */
                  INFO_DATATYPE_FLOAT64     = 9,       /* Signed 64 bit floating point number. */
                  INFO_DATATYPE_PTR         = 10,      /* Pointer type (void*). Size is platform dependent (32 bit on 32 bit platforms). */
                  INFO_DATATYPE_BOOL8       = 11,      /* Boolean value occupying 8 bit. 0 for false and anything for true. */
                  INFO_DATATYPE_SIZET       = 12,      /* Platform dependent unsigned integer (32 bit on 32 bit platforms). */
                  INFO_DATATYPE_BUFFER      = 13,      /* Like a INFO_DATATYPE_STRING but with arbitrary data and no NULL termination. */
                  INFO_DATATYPE_PTRDIFF     = 14,      /* Platform dependent signed integer (32 bit on 32 bit platforms). GenTL v1.3 */
            
                  INFO_DATATYPE_CUSTOM_ID   = 1000     /* Starting value for custom IDs. */
                };
                typedef int32_t INFO_DATATYPE;
            
                /* Defines char encoding schemes used by the producer, GenTL v1.4 */
                enum TL_CHAR_ENCODING_LIST
                {
                  TL_CHAR_ENCODING_ASCII    = 0,
                  TL_CHAR_ENCODING_UTF8     = 1
                };
                typedef int32_t TL_CHAR_ENCODING;       /* GenTL v1.4 */
            
                /* System module information commands for the GenTL::TLGetInfo and GenTL::GCGetInfo functions. */
                enum  TL_INFO_CMD_LIST
                {
                  TL_INFO_ID              = 0,    /* STRING    Transport layer ID. */
                  TL_INFO_VENDOR          = 1,    /* STRING    Transport layer vendor name. */
                  TL_INFO_MODEL           = 2,    /* STRING    Transport layer model name. */
                  TL_INFO_VERSION         = 3,    /* STRING    Transport layer version. */
                  TL_INFO_TLTYPE          = 4,    /* STRING    Transport layer technology that is supported. */
                  TL_INFO_NAME            = 5,    /* STRING    File name including extension of the library. */
                  TL_INFO_PATHNAME        = 6,    /* STRING    Full path including file name and extension of the library. */
                  TL_INFO_DISPLAYNAME     = 7,    /* STRING    User readable name of the device. If this is not defined in the device this should be VENDOR MODEL (ID). */
                  TL_INFO_CHAR_ENCODING   = 8,    /* INT32     Reporting the char encoding used by this Producer, GenTL v1.4 */
                  TL_INFO_GENTL_VER_MAJOR = 9,    /* UINT32    Major number of the GenTL spec this producer complies with, GenTL v1.5 */
                  TL_INFO_GENTL_VER_MINOR = 10,   /* UINT32    Minor number of the GenTL spec this producer complies with, GenTL v1.5 */
                  TL_INFO_CUSTOM_ID       = 1000  /* Starting value for custom IDs. */
                };
                typedef int32_t TL_INFO_CMD;
            
                /* This enumeration defines commands to retrieve information with the GenTL::IFGetInfo function from the Interface module. */
                enum INTERFACE_INFO_CMD_LIST
                {
                  INTERFACE_INFO_ID              = 0,     /* STRING     Unique ID of the interface. */
                  INTERFACE_INFO_DISPLAYNAME     = 1,     /* STRING     User readable name of the interface. */
                  INTERFACE_INFO_TLTYPE          = 2,     /* STRING     Transport layer technology that is supported. */
                  INTERFACE_INFO_CUSTOM_ID       = 1000   /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t INTERFACE_INFO_CMD;
            
                /* This enumeration defines flags of how a device is to be opened with the GenTL::IFOpenDevice function. */
                enum DEVICE_ACCESS_FLAGS_LIST
                {
                  DEVICE_ACCESS_UNKNOWN   = 0,         /* Not used in a command. Can be used to initialize a variable to query that information. */
                  DEVICE_ACCESS_NONE      = 1,         /* This either means that the device is not open because it was not opened before or the access to it was denied. */
                  DEVICE_ACCESS_READONLY  = 2,         /* Open the device read only. All Port functions can only read from the device. */
                  DEVICE_ACCESS_CONTROL   = 3,         /* Open the device in a way that other hosts/processes can have read only access to the device. Device access level is read/write for this process. */
                  DEVICE_ACCESS_EXCLUSIVE = 4,         /* Open the device in a way that only this host/process can have access to the device. Device access level is read/write for this process. */
            
                  DEVICE_ACCESS_CUSTOM_ID = 1000       /*  Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t DEVICE_ACCESS_FLAGS;
            
                /* This enumeration defines values for the accessibility of the device to be returned in the GenTL::DevGetInfo function on a device handle. */
                enum DEVICE_ACCESS_STATUS_LIST
                {
                  DEVICE_ACCESS_STATUS_UNKNOWN        = 0, /* The device accessibility is not known. */
                  DEVICE_ACCESS_STATUS_READWRITE      = 1, /* The device is available for read/write access. */
                  DEVICE_ACCESS_STATUS_READONLY       = 2, /* The device is available for read only access. */
                  DEVICE_ACCESS_STATUS_NOACCESS       = 3, /* The device is not accessible. */
                  DEVICE_ACCESS_STATUS_BUSY           = 4, /* The device has already been opened by another process/host. GenTL v1.5 */
                  DEVICE_ACCESS_STATUS_OPEN_READWRITE = 5, /* The device has already been opened by this process. GenTL v1.5 */
                  DEVICE_ACCESS_STATUS_OPEN_READONLY  = 6, /* The device has already been opened by this process. GenTL v1.5 */
            
                  DEVICE_ACCESS_STATUS_CUSTOM_ID = 1000 /* Starting value for custom IDs. */
                };
                typedef int32_t DEVICE_ACCESS_STATUS;
            
                /* This enumeration defines commands to retrieve information with the GenTL::DevGetInfo function on a device handle. */
                enum DEVICE_INFO_CMD_LIST
                {
                  DEVICE_INFO_ID                  = 0,    /* STRING     Unique ID of the device. */
                  DEVICE_INFO_VENDOR              = 1,    /* STRING     Device vendor name. */
                  DEVICE_INFO_MODEL               = 2,    /* STRING     Device model name. */
                  DEVICE_INFO_TLTYPE              = 3,    /* STRING     Transport layer technology that is supported. */
                  DEVICE_INFO_DISPLAYNAME         = 4,    /* STRING     String containing a display name for the device ( including a unique id ) */
                  DEVICE_INFO_ACCESS_STATUS       = 5,    /* INT32      Gets the access mode the GenTL Producer has on the opened device. (DEVICE_ACCESS_STATUS enumeration value). */
                  DEVICE_INFO_USER_DEFINED_NAME   = 6,    /* STRING     String containing the user defined name, GenTL v1.4  */
                  DEVICE_INFO_SERIAL_NUMBER       = 7,    /* STRING     String containing the device's serial number, GenTL v1.4  */
                  DEVICE_INFO_VERSION             = 8,    /* STRING     String containing the device version, GenTL v1.4  */
                  DEVICE_INFO_TIMESTAMP_FREQUENCY = 9,    /* UINT64     Tick-frequency of the time stamp clock, GenTL v1.4 */
            
                  DEVICE_INFO_CUSTOM_ID       = 1000    /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t DEVICE_INFO_CMD;
            
                /* This enumeration defines special stop flags for the acquisition engine. The function used is GenTL::DSStopAcquisition. */
                enum ACQ_STOP_FLAGS_LIST
                {
                  ACQ_STOP_FLAGS_DEFAULT    = 0,         /* Stop the acquisition engine when the currently running tasks like filling a buffer are completed (default behavior). */
                  ACQ_STOP_FLAGS_KILL       = 1,         /* Stop the acquisition engine immediately and leave buffers currently being filled in the Input Buffer Pool. */
            
                  ACQ_STOP_FLAGS_CUSTOM_ID  = 1000       /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t ACQ_STOP_FLAGS;
            
                /* This enumeration defines special start flags for the acquisition engine. The function used is GenTL::DSStartAcquisition. */
                enum ACQ_START_FLAGS_LIST
                {
                  ACQ_START_FLAGS_DEFAULT     = 0,      /* Default behavior. */
            
                  ACQ_START_FLAGS_CUSTOM_ID   = 1000    /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t ACQ_START_FLAGS;
            
                /* This enumeration commands from which to which queue/pool buffers are flushed with the GenTL::DSFlushQueue function. */
                enum ACQ_QUEUE_TYPE_LIST
                {
                  ACQ_QUEUE_INPUT_TO_OUTPUT           = 0,    /* Flushes the input pool to the output queue and if necessary adds entries in the New Buffer event data queue. */
                  ACQ_QUEUE_OUTPUT_DISCARD            = 1,    /* Discards all buffers in the output queue and if necessary remove the entries from the event data queue. */
                  ACQ_QUEUE_ALL_TO_INPUT              = 2,    /* Puts all buffers in the input pool. Even those in the output queue and discard entries in the event data queue. */
                  ACQ_QUEUE_UNQUEUED_TO_INPUT         = 3,    /* Puts all buffers that are not in the input pool or the output queue in the input pool. */
                  ACQ_QUEUE_ALL_DISCARD               = 4,    /* Discards all buffers in the input pool and output queue. */
            
                  ACQ_QUEUE_CUSTOM_ID                 = 1000  /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t ACQ_QUEUE_TYPE;
            
                /* This enumeration defines commands to retrieve information with the GenTL::DSGetInfo function on a data stream handle */
                enum STREAM_INFO_CMD_LIST
                {
                  STREAM_INFO_ID                         =  0,   /* STRING     Unique ID of the data stream. */
                  STREAM_INFO_NUM_DELIVERED              =  1,   /* UINT64     Number of delivered buffers since last acquisition start. */
                  STREAM_INFO_NUM_UNDERRUN               =  2,   /* UINT64     Number of lost buffers due to queue underrun. */
                  STREAM_INFO_NUM_ANNOUNCED              =  3,   /* SIZET      Number of announced buffers. */
                  STREAM_INFO_NUM_QUEUED                 =  4,   /* SIZET      Number of buffers in the input pool. */
                  STREAM_INFO_NUM_AWAIT_DELIVERY         =  5,   /* SIZET      Number of buffers in the output queue. */
                  STREAM_INFO_NUM_STARTED                =  6,   /* UINT64     Number of buffers started in the acquisition engine. */
                  STREAM_INFO_PAYLOAD_SIZE               =  7,   /* SIZET      Size of the expected data in bytes. */
                  STREAM_INFO_IS_GRABBING                =  8,   /* BOOL8      Flag indicating whether the acquisition engine is started or not. */
                  STREAM_INFO_DEFINES_PAYLOADSIZE        =  9,   /* BOOL8      Flag that indicated that this data stream defines a payload size independent from the remote device. */
                  STREAM_INFO_TLTYPE                     = 10,   /* STRING     Transport layer technology that is supported. */
                  STREAM_INFO_NUM_CHUNKS_MAX             = 11,   /* SIZET      Max number of chunks in a buffer, if known. GenTL v1.3 */
                  STREAM_INFO_BUF_ANNOUNCE_MIN           = 12,   /* SIZET      Min number of buffers to announce before acq can start, if known. GenTL v1.3 */
                  STREAM_INFO_BUF_ALIGNMENT              = 13,   /* SIZET      Buffer alignment in bytes. GenTL v1.3 */
                  STREAM_INFO_FLOW_TABLE                 = 14,   /* BUFFER     Flow mapping table in GenDC format. GenTL v1.6 */
                  STREAM_INFO_GENDC_PREFETCH_DESCRIPTOR  = 15,   /* BUFFER     Prefetch version of GenDC descriptor. GenTL v1.6 */
            
                  STREAM_INFO_CUSTOM_ID                  = 1000  /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t STREAM_INFO_CMD;
            
                /* This enumeration defines commands to retrieve information with the GenTL::DSGetBufferInfo function on a buffer handle. */
                enum  BUFFER_INFO_CMD_LIST
                {
                  BUFFER_INFO_BASE                            = 0,  /* PTR        Base address of the buffer memory. */
                  BUFFER_INFO_SIZE                            = 1,  /* SIZET      Size of the buffer in bytes. */
                  BUFFER_INFO_USER_PTR                        = 2,  /* PTR        Private data pointer of the GenTL Consumer. */
                  BUFFER_INFO_TIMESTAMP                       = 3,  /* UINT64     Timestamp the buffer was acquired. */
                  BUFFER_INFO_NEW_DATA                        = 4,  /* BOOL8      Flag to indicate that the buffer contains new data since the last call. */
                  BUFFER_INFO_IS_QUEUED                       = 5,  /* BOOL8      Flag to indicate if the buffer is in the input pool or output queue. */
                  BUFFER_INFO_IS_ACQUIRING                    = 6,  /* BOOL8      Flag to indicate that the buffer is currently being filled with data. */
                  BUFFER_INFO_IS_INCOMPLETE                   = 7,  /* BOOL8      Flag to indicate that a buffer was filled but an error occurred during that process. */
                  BUFFER_INFO_TLTYPE                          = 8,  /* STRING     Transport layer technology that is supported. */
                  BUFFER_INFO_SIZE_FILLED                     = 9,  /* SIZET      Number of bytes written into the buffer last time it has been filled. This value is reset to 0 when the buffer is placed into the Input Buffer Pool. */
                  BUFFER_INFO_WIDTH                           = 10, /* SIZET      GenTL v1.2 */
                  BUFFER_INFO_HEIGHT                          = 11, /* SIZET      GenTL v1.2 */
                  BUFFER_INFO_XOFFSET                         = 12, /* SIZET      GenTL v1.2 */
                  BUFFER_INFO_YOFFSET                         = 13, /* SIZET      GenTL v1.2 */
                  BUFFER_INFO_XPADDING                        = 14, /* SIZET      GenTL v1.2 */
                  BUFFER_INFO_YPADDING                        = 15, /* SIZET      GenTL v1.2 */
                  BUFFER_INFO_FRAMEID                         = 16, /* UINT64     GenTL v1.2 */
                  BUFFER_INFO_IMAGEPRESENT                    = 17, /* BOOL8      GenTL v1.2 */
                  BUFFER_INFO_IMAGEOFFSET                     = 18, /* SIZET      GenTL v1.2 */
                  BUFFER_INFO_PAYLOADTYPE                     = 19, /* SIZET      GenTL v1.2 */
                  BUFFER_INFO_PIXELFORMAT                     = 20, /* UINT64     GenTL v1.2 */
                  BUFFER_INFO_PIXELFORMAT_NAMESPACE           = 21, /* UINT64     GenTL v1.2 */
                  BUFFER_INFO_DELIVERED_IMAGEHEIGHT           = 22, /* SIZET      GenTL v1.2 */
                  BUFFER_INFO_DELIVERED_CHUNKPAYLOADSIZE      = 23, /* SIZET      GenTL v1.2 */
                  BUFFER_INFO_CHUNKLAYOUTID                   = 24, /* UINT64     GenTL v1.2 */
                  BUFFER_INFO_FILENAME                        = 25, /* STRING     GenTL v1.2 */
                  BUFFER_INFO_PIXEL_ENDIANNESS                = 26, /* INT32      GenTL v1.4 */
                  BUFFER_INFO_DATA_SIZE                       = 27, /* SIZET      GenTL v1.4 */
                  BUFFER_INFO_TIMESTAMP_NS                    = 28, /* UINT64     GenTL v1.4 */
                  BUFFER_INFO_DATA_LARGER_THAN_BUFFER         = 29, /* BOOL8      GenTL v1.4 */
                  BUFFER_INFO_CONTAINS_CHUNKDATA              = 30, /* BOOL8      GenTL v1.4 */
                  BUFFER_INFO_IS_COMPOSITE                    = 31, /* BOOL8      GenTL v1.6 */
            
                  BUFFER_INFO_CUSTOM_ID                       = 1000 /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t BUFFER_INFO_CMD;
            
                /* This enumeration defines commands to retrieve information about individual data parts in a multi-part buffer
                 using the GenTL::DSGetBufferPartInfo function. Introduced in GenTL v1.5. */
                enum  BUFFER_PART_INFO_CMD_LIST
                {
                  BUFFER_PART_INFO_BASE                       = 0,  /* PTR        Base address of the buffer part memory. */
                  BUFFER_PART_INFO_DATA_SIZE                  = 1,  /* SIZET      Size of the buffer part in bytes. */
                  BUFFER_PART_INFO_DATA_TYPE                  = 2,  /* SIZET      Type of the data in given part (PARTDATATYPE_ID enumeration value). */
                  BUFFER_PART_INFO_DATA_FORMAT                = 3,  /* UINT64     Format of individual items (such as pixels) in the buffer part. */
                  BUFFER_PART_INFO_DATA_FORMAT_NAMESPACE      = 4,  /* UINT64     Allows interpretation of BUFFER_PART_INFO_DATA_FORMAT (PIXELFORMAT_NAMESPACE_ID enumeration value). */
                  BUFFER_PART_INFO_WIDTH                      = 5,  /* SIZET      Width of data in the buffer part in pixels. */
                  BUFFER_PART_INFO_HEIGHT                     = 6,  /* SIZET      Expected height of data in the buffer part in pixels . */
                  BUFFER_PART_INFO_XOFFSET                    = 7,  /* SIZET      Horizontal offset of data in the buffer part in pixels. */
                  BUFFER_PART_INFO_YOFFSET                    = 8,  /* SIZET      Vertical offset of data in the buffer part in pixels. */
                  BUFFER_PART_INFO_XPADDING                   = 9,  /* SIZET      Horizontal padding of data in the buffer part in pixels. */
                  BUFFER_PART_INFO_SOURCE_ID                  = 10, /* UINT64     Identifier allowing to group data parts belonging to the same source. */
                  BUFFER_PART_INFO_DELIVERED_IMAGEHEIGHT      = 11, /* SIZET      Height of the data currently in the buffer part in pixels*/
                  BUFFER_PART_INFO_REGION_ID                  = 12, /* UINT64     Identifier allowing to group data parts belonging to the same region. GenTL v1.6 */
                  BUFFER_PART_INFO_DATA_PURPOSE_ID            = 13, /* UINT64     Identifier allowing to group data parts having the same purpose. GenTL v1.6 */
                  BUFFER_PART_INFO_CUSTOM_ID                  = 1000 /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t BUFFER_PART_INFO_CMD;   /* GenTL v1.5 */
            
                /* Enumeration of TLType dependent payload types. Introduced in GenTL v1.2 */
                enum PAYLOADTYPE_INFO_IDS
                {
                  PAYLOAD_TYPE_UNKNOWN         =  0,   /* GenTL v1.2 */
                  PAYLOAD_TYPE_IMAGE           =  1,   /* GenTL v1.2 */
                  PAYLOAD_TYPE_RAW_DATA        =  2,   /* GenTL v1.2 */
                  PAYLOAD_TYPE_FILE            =  3,   /* GenTL v1.2 */
                  PAYLOAD_TYPE_CHUNK_DATA      =  4,   /* GenTL v1.2, Deprecated in GenTL 1.5*/
                  PAYLOAD_TYPE_JPEG            =  5,   /* GenTL v1.4 */
                  PAYLOAD_TYPE_JPEG2000        =  6,   /* GenTL v1.4 */
                  PAYLOAD_TYPE_H264            =  7,   /* GenTL v1.4 */
                  PAYLOAD_TYPE_CHUNK_ONLY      =  8,   /* GenTL v1.4 */
                  PAYLOAD_TYPE_DEVICE_SPECIFIC =  9,   /* GenTL v1.4 */
                  PAYLOAD_TYPE_MULTI_PART      =  10,  /* GenTL v1.5 */
                  PAYLOAD_TYPE_GENDC           =  11,  /* GenTL v1.6 */
            
                  PAYLOAD_TYPE_CUSTOM_ID       = 1000  /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t PAYLOADTYPE_INFO_ID;
            
                /* Enumeration of TLType dependent pixel format namespaces introduced GenTL v1.2 */
                enum PIXELFORMAT_NAMESPACE_IDS
                {
                  PIXELFORMAT_NAMESPACE_UNKNOWN      = 0,   /* GenTL v1.2 */
                  PIXELFORMAT_NAMESPACE_GEV          = 1,   /* GenTL v1.2 */
                  PIXELFORMAT_NAMESPACE_IIDC         = 2,   /* GenTL v1.2 */
                  PIXELFORMAT_NAMESPACE_PFNC_16BIT   = 3,   /* GenTL v1.4 */
                  PIXELFORMAT_NAMESPACE_PFNC_32BIT   = 4,   /* GenTL v1.4 */
            
                  PIXELFORMAT_NAMESPACE_CUSTOM_ID    = 1000 /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t PIXELFORMAT_NAMESPACE_ID;   /* GenTL v1.2 */
            
                /* Enumeration of pixel endianness values. Introduced in GenTL v1.4 */
                enum PIXELENDIANNESS_IDS
                {
                  PIXELENDIANNESS_UNKNOWN  = 0,    /* Unknown pixel endianness. GenTL v1.4 */
                  PIXELENDIANNESS_LITTLE   = 1,    /* Little endian pixel data. GenTL v1.4 */
                  PIXELENDIANNESS_BIG      = 2     /* Big endian pixel data. GenTL v1.4 */
                };
                typedef int32_t PIXELENDIANNESS_ID; /* GenTL v1.4*/ 
            
                /* Enumeration describing which data type is present in given buffer part. Introduced in GenTL v1.5 */
                enum PARTDATATYPE_IDS
                {
                  PART_DATATYPE_UNKNOWN              =  0,   /* Unknown data type */
                  PART_DATATYPE_2D_IMAGE             =  1,   /* Color or monochrome 2D image. */
                  PART_DATATYPE_2D_PLANE_BIPLANAR    =  2,   /* Single color plane of a planar 2D image consisting of 2 planes. */
                  PART_DATATYPE_2D_PLANE_TRIPLANAR   =  3,   /* Single color plane of a planar 2D image consisting of 3 planes. */
                  PART_DATATYPE_2D_PLANE_QUADPLANAR  =  4,   /* Single color plane of a planar 2D image consisting of 4 planes. */
                  PART_DATATYPE_3D_IMAGE             =  5,   /* 3D image (pixel coordinates). */
                  PART_DATATYPE_3D_PLANE_BIPLANAR    =  6,   /* Single plane of a planar 3D image consisting of 2 planes. */
                  PART_DATATYPE_3D_PLANE_TRIPLANAR   =  7,   /* Single plane of a planar 3D image consisting of 3 planes. */
                  PART_DATATYPE_3D_PLANE_QUADPLANAR  =  8,   /* Single plane of a planar 3D image consisting of 4 planes. */
                  PART_DATATYPE_CONFIDENCE_MAP       =  9,   /* Confidence of the individual pixel values. */
                  PART_DATATYPE_JPEG                 =  10,  /* JPEG compressed data. GenTL v1.6 */
                  PART_DATATYPE_JPEG2000             =  11,  /* JPEG 2000 compressed data. GenTL v1.6 */
            
                  PART_DATATYPE_CUSTOM_ID            = 1000  /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t PARTDATATYPE_ID; /* GenTL v1.5*/
            
                /* This enumeration defines commands to retrieve information with the GenTL::GCGetPortInfo function on a module or remote device handle. */
                enum PORT_INFO_CMD_LIST
                {
                  PORT_INFO_ID              = 0,       /* STRING     Unique ID of the port. */
                  PORT_INFO_VENDOR          = 1,       /* STRING     Port vendor name. */
                  PORT_INFO_MODEL           = 2,       /* STRING     Port model name. */
                  PORT_INFO_TLTYPE          = 3,       /* STRING     Transport layer technology that is supported. */
                  PORT_INFO_MODULE          = 4,       /* STRING     GenTL Module the port refers to. */
                  PORT_INFO_LITTLE_ENDIAN   = 5,       /* BOOL8      Flag indicating that the port data is little endian. */
                  PORT_INFO_BIG_ENDIAN      = 6,       /* BOOL8      Flag indicating that the port data is big endian. */
                  PORT_INFO_ACCESS_READ     = 7,       /* BOOL8      Port has read access. */
                  PORT_INFO_ACCESS_WRITE    = 8,       /* BOOL8      Port has write access. */
                  PORT_INFO_ACCESS_NA       = 9,       /* BOOL8      Port is not accessible. */
                  PORT_INFO_ACCESS_NI       = 10,      /* BOOL8      Port is not implemented. */
                  PORT_INFO_VERSION         = 11,      /* STRING     Version of the port. */
                  PORT_INFO_PORTNAME        = 12,      /* STRING     Name of the port as referenced in the XML description. */
            
                  PORT_INFO_CUSTOM_ID       = 1000     /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t PORT_INFO_CMD;
            
                /* This enumeration defines enum values returned by the URL_INFO_SCHEME command.
                 introduced in GenTL v1.5 */
                enum URL_SCHEME_IDS
                {
                  URL_SCHEME_LOCAL         = 0,        /* The XML can be read from the local register map */
                  URL_SCHEME_HTTP          = 1,        /* The XML can be downloaded from a http server */
                  URL_SCHEME_FILE          = 2,        /* The XML can be read from the local hard drive */
            
                  URL_SCHEME_CUSTOM_ID     = 1000      /* Starting value for custom scheme locations */
                };
                typedef int32_t URL_SCHEME_ID;
            
                /* This enumeration defines commands to retrieve information with the GenTL::GCGetPortURLInfo
                 function on a module or remote device handle. Introduced in GenTL v1.1 */
                enum URL_INFO_CMD_LIST
                {
                  URL_INFO_URL                   = 0,  /* STRING     URL as defined in chapter 4.1.2 GenTL v1.1  */
                  URL_INFO_SCHEMA_VER_MAJOR      = 1,  /* INT32      Major version of the schema this URL refers to. GenTL v1.1 */
                  URL_INFO_SCHEMA_VER_MINOR      = 2,  /* INT32      Minor version of the schema this URL refers to. GenTL v1.1 */
                  URL_INFO_FILE_VER_MAJOR        = 3,  /* INT32      Major version of the XML-file this URL refers to. GenTL v1.1 */
                  URL_INFO_FILE_VER_MINOR        = 4,  /* INT32      Minor version of the XML-file this URL refers to. GenTL v1.1 */
                  URL_INFO_FILE_VER_SUBMINOR     = 5,  /* INT32      Subminor version of the XML-file this URL refers to. GenTL v1.1 */
                  URL_INFO_FILE_SHA1_HASH        = 6,  /* BUFFER     160-bit SHA1 Hash code of XML-file. GenTL v1.4 */
                  URL_INFO_FILE_REGISTER_ADDRESS = 7,  /* UINT64     Register address in the device's register map. GenTL v1.5 */
                  URL_INFO_FILE_SIZE             = 8,  /* UINT64     File size in bytes. GenTL v1.5 */
                  URL_INFO_SCHEME                = 9,  /* INT32      Scheme of the URL as defined in URL_SCHEME_IDS. GenTL v1.5 */
                  URL_INFO_FILENAME              = 10, /* STRING     File name if the scheme of the URL is file. GenTL v1.5 */
            
                  URL_INFO_CUSTOM_ID             = 1000     /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t URL_INFO_CMD;  /* GenTL v1.1 */
            
                /* Known event types that can be registered on certain modules with the GenTL::GCRegisterEvent function. */
                enum EVENT_TYPE_LIST
                {
                  EVENT_ERROR               = 0,     /* Notification on module errors. */
                  EVENT_NEW_BUFFER          = 1,     /* Notification on newly filled buffers. */
                  EVENT_FEATURE_INVALIDATE  = 2,     /* Notification if a feature was changed by the GenTL Producer library and thus needs to be invalidated in the GenICam GenApi instance using the module. */
                  EVENT_FEATURE_CHANGE      = 3,     /* Notification if the GenTL Producer library wants to manually set a feature in the GenICam GenApi instance using the module. */
                  EVENT_REMOTE_DEVICE       = 4,     /* Notification if the GenTL Producer wants to inform the GenICam GenApi instance of the remote device that a GenApi compatible event was fired. */
                  EVENT_MODULE              = 5,     /* Notification if the GenTL Producer wants to inform the GenICam GenApi instance of the module that a GenApi compatible event was fired.  GenTL v1.4 */
            
                  EVENT_CUSTOM_ID           = 1000   /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t  EVENT_TYPE;
            
                /* Event info command */
                enum EVENT_INFO_CMD_LIST
                {
                  EVENT_EVENT_TYPE            = 0,    /* INT32      The event type of the event handle (EVENT_TYPE enum value). */
                  EVENT_NUM_IN_QUEUE          = 1,    /* SIZET      Number of events in the event data queue. */
                  EVENT_NUM_FIRED             = 2,    /* UINT64     Number of events that were fired since the creation of the module. */
                  EVENT_SIZE_MAX              = 3,    /* SIZET      Max size of data carried with an event in bytes. GenTL v1.2 */
                  EVENT_INFO_DATA_SIZE_MAX    = 4,    /* SIZET      Max size of data provided through EventGetDataInfo in bytes. GenTL v1.2 */
            
                  EVENT_INFO_CUSTOM_ID        = 1000  /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t EVENT_INFO_CMD;
            
                /* Event data info command */
                enum EVENT_DATA_INFO_CMD_LIST
                {
                  EVENT_DATA_ID           = 0,      /* Event specific    Unique Event ID (String or Number)*/
                  EVENT_DATA_VALUE        = 1,      /* Event specific Data */
                  EVENT_DATA_NUMID        = 2,      /* UINT64   Numeric representation of the unique Event ID, GenTL v1.3. */
            
                  EVENT_DATA_CUSTOM_ID    = 1000    /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t EVENT_DATA_INFO_CMD;
            
                /* This enumeration defines commands to retrieve information about individual data stream flows
                 using the GenTL::DSGetFlowInfo function. Introduced in GenTL v1.6. */
                enum  FLOW_INFO_CMD_LIST
                {
                  FLOW_INFO_SIZE                              = 0,  /* SIZET      Size of the flow in bytes. */
                  FLOW_INFO_CUSTOM_ID                         = 1000 /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t FLOW_INFO_CMD;   /* GenTL v1.6 */
            
                /* This enumeration defines commands to retrieve information about composite buffer segments
                 using the GenTL::DSGetBufferSegmentInfo function. Introduced in GenTL v1.6. */
                enum  SEGMENT_INFO_CMD_LIST
                {
                  SEGMENT_INFO_BASE                           = 0,  /* PTR        Based address of the buffer segment memory. */
                  SEGMENT_INFO_SIZE                           = 1,  /* SIZET      Size of the buffer segment in bytes. */
                  SEGMENT_INFO_IS_INCOMPLETE                  = 2,  /* BOOL8      Flag to indicate that an error occured while filling the segment. */
                  SEGMENT_INFO_SIZE_FILLED                    = 3,  /* SIZET      Number of bytes written into the buffer last time it has been filled. */
                  SEGMENT_INFO_DATA_SIZE                      = 4,  /* SIZET      Size of the data intended to be written to the buffer last time it has been filled. */
                  SEGMENT_INFO_CUSTOM_ID                      = 1000 /* Starting value for GenTL Producer custom IDs. */
                };
                typedef int32_t SEGMENT_INFO_CMD;   /* GenTL v1.6 */
            
                /* Structure of the data returned from a signaled "New Buffer" event. */
            #   pragma pack (push, 1)
                typedef struct S_EVENT_NEW_BUFFER
                {
                  BUFFER_HANDLE   BufferHandle;        /* Buffer handle which contains new data. */
                  void*           pUserPointer;        /* User pointer provided at announcement of the buffer. */
                } EVENT_NEW_BUFFER_DATA;
            #   pragma pack (pop)
            
                /* Structure to be use with GCWritePortStacked and GCReadPortStacked. */
            #   pragma pack (push, 1)
                typedef struct S_PORT_REGISTER_STACK_ENTRY
                {
                  uint64_t   Address;        /* Address of the register. */
                  void*      pBuffer;        /* Pointer to the buffer containing the data. */
                  size_t     Size;           /* Number of bytes to read write. */
                } PORT_REGISTER_STACK_ENTRY;
            #   pragma pack (pop)
            
            #   pragma pack (push, 1)
                /* Structure carrying information about a single chunk in the buffer. Introduced in GenTL v1.3. */
                typedef struct S_SINGLE_CHUNK_DATA
                {
                  uint64_t ChunkID;       /* Numeric representation of ChunkID */
                  ptrdiff_t ChunkOffset;  /* Chunk offset in the buffer */
                  size_t ChunkLength;     /* Size of the chunk data */
                } SINGLE_CHUNK_DATA;
            #   pragma pack (pop)
            
            #   pragma pack (push, 1)
                /* Structure carrying information about a buffer info within a stacked request. Introduced in GenTL v1.6. */
                typedef struct S_DS_BUFFER_INFO_STACKED
                {
                  BUFFER_INFO_CMD iInfoCmd; /* Queried buffer info */
                  INFO_DATATYPE iType;      /* The info's data type */
                  void* pBuffer;            /* Pointer to buffer to hold the info data */
                  size_t iSize;             /* Size of the info buffer (in) and the actual info data (out) */
                  GC_ERROR iResult;         /* Result of the buffer info queury */
                } DS_BUFFER_INFO_STACKED;
            #   pragma pack (pop)
            
            #   pragma pack (push, 1)
                /* Structure carrying information about a buffer part info within a stacked request. Introduced in GenTL v1.6. */
                typedef struct S_DS_BUFFER_PART_INFO_STACKED
                {
                  uint32_t iPartIndex;      /* Index of buffer part to query */
                  BUFFER_PART_INFO_CMD iInfoCmd; /* Queried buffer part info */
                  GC_ERROR iResult;         /* Result of the buffer info queury */
                  INFO_DATATYPE iType;      /* The info's data type */
                  void* pBuffer;            /* Pointer to buffer to hold the info data */
                  size_t iSize;             /* Size of the info buffer (in) and the actual info data (out) */
                } DS_BUFFER_PART_INFO_STACKED;
            #   pragma pack (pop)
            
            
                /* C API Interface Functions */
            #   define GC_API GC_IMPORT_EXPORT GC_ERROR GC_CALLTYPE
                GC_API GCGetInfo               ( TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
            
                GC_API GCGetLastError          ( GC_ERROR *piErrorCode, char *sErrText, size_t *piSize );
            
                GC_API GCInitLib               ( void );
                GC_API GCCloseLib              ( void );
            
                GC_API GCReadPort              ( PORT_HANDLE hPort, uint64_t iAddress, void *pBuffer, size_t *piSize );
                GC_API GCWritePort             ( PORT_HANDLE hPort, uint64_t iAddress, const void *pBuffer, size_t *piSize );
                GC_API GCGetPortURL            ( PORT_HANDLE hPort, char *sURL, size_t *piSize );
            
                GC_API GCGetPortInfo           ( PORT_HANDLE hPort, PORT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
            
                GC_API GCRegisterEvent         ( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID, EVENT_HANDLE *phEvent );
                GC_API GCUnregisterEvent       ( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID );
            
                GC_API EventGetData            ( EVENT_HANDLE hEvent, void *pBuffer, size_t *piSize, uint64_t iTimeout );
                GC_API EventGetDataInfo        ( EVENT_HANDLE hEvent, const void *pInBuffer, size_t iInSize, EVENT_DATA_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pOutBuffer, size_t *piOutSize );
                GC_API EventGetInfo            ( EVENT_HANDLE hEvent, EVENT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API EventFlush              ( EVENT_HANDLE hEvent );
                GC_API EventKill               ( EVENT_HANDLE hEvent );
            
                GC_API TLOpen                  ( TL_HANDLE *phTL );
                GC_API TLClose                 ( TL_HANDLE hTL );
                GC_API TLGetInfo               ( TL_HANDLE hTL, TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
            
                GC_API TLGetNumInterfaces      ( TL_HANDLE hTL, uint32_t *piNumIfaces );
                GC_API TLGetInterfaceID        ( TL_HANDLE hTL, uint32_t iIndex,  char *sID, size_t *piSize );
                GC_API TLGetInterfaceInfo      ( TL_HANDLE hTL, const char *sIfaceID, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API TLOpenInterface         ( TL_HANDLE hTL, const char *sIfaceID, IF_HANDLE *phIface );
                GC_API TLUpdateInterfaceList   ( TL_HANDLE hTL, bool8_t *pbChanged, uint64_t iTimeout );
            
                GC_API IFClose                 ( IF_HANDLE hIface );
                GC_API IFGetInfo               ( IF_HANDLE hIface, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
            
                GC_API IFGetNumDevices         ( IF_HANDLE hIface, uint32_t *piNumDevices );
                GC_API IFGetDeviceID           ( IF_HANDLE hIface, uint32_t iIndex, char *sIDeviceID, size_t *piSize );
                GC_API IFUpdateDeviceList      ( IF_HANDLE hIface, bool8_t *pbChanged, uint64_t iTimeout );
                GC_API IFGetDeviceInfo         ( IF_HANDLE hIface, const char *sDeviceID, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API IFOpenDevice            ( IF_HANDLE hIface, const char *sDeviceID, DEVICE_ACCESS_FLAGS iOpenFlag, DEV_HANDLE *phDevice );
            
                GC_API DevGetPort              ( DEV_HANDLE hDevice, PORT_HANDLE *phRemoteDevice );
                GC_API DevGetNumDataStreams    ( DEV_HANDLE hDevice, uint32_t *piNumDataStreams );
                GC_API DevGetDataStreamID      ( DEV_HANDLE hDevice, uint32_t iIndex, char *sDataStreamID, size_t *piSize );
                GC_API DevOpenDataStream       ( DEV_HANDLE hDevice, const char *sDataStreamID, DS_HANDLE *phDataStream );
                GC_API DevGetInfo              ( DEV_HANDLE hDevice, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API DevClose                ( DEV_HANDLE hDevice );
            
                GC_API DSAnnounceBuffer        ( DS_HANDLE hDataStream, void *pBuffer, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer );
                GC_API DSAllocAndAnnounceBuffer( DS_HANDLE hDataStream, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer );
                GC_API DSFlushQueue            ( DS_HANDLE hDataStream, ACQ_QUEUE_TYPE iOperation );
                GC_API DSStartAcquisition      ( DS_HANDLE hDataStream, ACQ_START_FLAGS iStartFlags, uint64_t iNumToAcquire );
                GC_API DSStopAcquisition       ( DS_HANDLE hDataStream, ACQ_STOP_FLAGS iStopFlags );
                GC_API DSGetInfo               ( DS_HANDLE hDataStream, STREAM_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API DSGetBufferID           ( DS_HANDLE hDataStream, uint32_t iIndex, BUFFER_HANDLE *phBuffer );
                GC_API DSClose                 ( DS_HANDLE hDataStream );
            
                GC_API DSRevokeBuffer          ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, void **pBuffer, void **pPrivate );
                GC_API DSQueueBuffer           ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer );
                GC_API DSGetBufferInfo         ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, BUFFER_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
            
                /* GenTL v1.1 */
                GC_API GCGetNumPortURLs        ( PORT_HANDLE hPort, uint32_t *piNumURLs );
                GC_API GCGetPortURLInfo        ( PORT_HANDLE hPort, uint32_t iURLIndex, URL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API GCReadPortStacked       ( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries );
                GC_API GCWritePortStacked      ( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries );
            
                /* GenTL v1.3 */
                GC_API DSGetBufferChunkData    ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, SINGLE_CHUNK_DATA *pChunkData, size_t *piNumChunks );
            
                /* GenTL v1.4 */
                GC_API IFGetParentTL           ( IF_HANDLE hIface, TL_HANDLE *phSystem ); 
                GC_API DevGetParentIF          ( DEV_HANDLE hDevice, IF_HANDLE *phIface );
                GC_API DSGetParentDev          ( DS_HANDLE hDataStream, DEV_HANDLE *phDevice );
            
                /* GenTL v1.5 */
                GC_API DSGetNumBufferParts     ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t *piNumParts );
                GC_API DSGetBufferPartInfo     ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t iPartIndex, BUFFER_PART_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
            
                /* GenTL v1.6 */
                GC_API DSAnnounceCompositeBuffer ( DS_HANDLE hDataStream, size_t iNumSegments, void **ppSegments, size_t *piSizes, void *pPrivate, BUFFER_HANDLE *phBuffer );
                GC_API DSGetBufferInfoStacked  ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, DS_BUFFER_INFO_STACKED *pInfoStacked, size_t iNumInfos );
                GC_API DSGetBufferPartInfoStacked( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, DS_BUFFER_PART_INFO_STACKED *pInfoStacked, size_t iNumInfos );
                GC_API DSGetNumFlows           ( DS_HANDLE hDataStream, uint32_t *piNumFlows );
                GC_API DSGetFlowInfo           ( DS_HANDLE hDataStream, uint32_t iFlowIndex, FLOW_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API DSGetNumBufferSegments  ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t *piNumSegments );
                GC_API DSGetBufferSegmentInfo  ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t iSegmentIndex, SEGMENT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
            
                /* typedefs for dynamic loading */
            #   define GC_API_P(function) typedef GC_ERROR( GC_CALLTYPE *function )
                GC_API_P(PGCGetInfo               )( TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API_P(PGCGetLastError          )( GC_ERROR *piErrorCode, char *sErrText, size_t *piSize );
                GC_API_P(PGCInitLib               )( void );
                GC_API_P(PGCCloseLib              )( void );
                GC_API_P(PGCReadPort              )( PORT_HANDLE hPort, uint64_t iAddress, void *pBuffer, size_t *piSize );
                GC_API_P(PGCWritePort             )( PORT_HANDLE hPort, uint64_t iAddress, const void *pBuffer, size_t *piSize );
                GC_API_P(PGCGetPortURL            )( PORT_HANDLE hPort, char *sURL, size_t *piSize );
                GC_API_P(PGCGetPortInfo           )( PORT_HANDLE hPort, PORT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
            
                GC_API_P(PGCRegisterEvent         )( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID, EVENT_HANDLE *phEvent );
                GC_API_P(PGCUnregisterEvent       )( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID );
                GC_API_P(PEventGetData            )( EVENT_HANDLE hEvent, void *pBuffer, size_t *piSize, uint64_t iTimeout );
                GC_API_P(PEventGetDataInfo        )( EVENT_HANDLE hEvent, const void *pInBuffer, size_t iInSize, EVENT_DATA_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pOutBuffer, size_t *piOutSize );
                GC_API_P(PEventGetInfo            )( EVENT_HANDLE hEvent, EVENT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API_P(PEventFlush              )( EVENT_HANDLE hEvent );
                GC_API_P(PEventKill               )( EVENT_HANDLE hEvent );
                GC_API_P(PTLOpen                  )( TL_HANDLE *phTL );
                GC_API_P(PTLClose                 )( TL_HANDLE hTL );
                GC_API_P(PTLGetInfo               )( TL_HANDLE hTL, TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API_P(PTLGetNumInterfaces      )( TL_HANDLE hTL, uint32_t *piNumIfaces );
                GC_API_P(PTLGetInterfaceID        )( TL_HANDLE hTL, uint32_t iIndex, char *sID, size_t *piSize );
                GC_API_P(PTLGetInterfaceInfo      )( TL_HANDLE hTL, const char *sIfaceID, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API_P(PTLOpenInterface         )( TL_HANDLE hTL, const char *sIfaceID, IF_HANDLE *phIface );
                GC_API_P(PTLUpdateInterfaceList   )( TL_HANDLE hTL, bool8_t *pbChanged, uint64_t iTimeout );
                GC_API_P(PIFClose                 )( IF_HANDLE hIface );
                GC_API_P(PIFGetInfo               )( IF_HANDLE hIface, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API_P(PIFGetNumDevices         )( IF_HANDLE hIface, uint32_t *piNumDevices );
                GC_API_P(PIFGetDeviceID           )( IF_HANDLE hIface, uint32_t iIndex, char *sIDeviceID, size_t *piSize );
                GC_API_P(PIFUpdateDeviceList      )( IF_HANDLE hIface, bool8_t *pbChanged, uint64_t iTimeout );
                GC_API_P(PIFGetDeviceInfo         )( IF_HANDLE hIface, const char *sDeviceID, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API_P(PIFOpenDevice            )( IF_HANDLE hIface, const char *sDeviceID, DEVICE_ACCESS_FLAGS iOpenFlag, DEV_HANDLE *phDevice );
            
                GC_API_P(PDevGetPort              )( DEV_HANDLE hDevice, PORT_HANDLE *phRemoteDevice );
                GC_API_P(PDevGetNumDataStreams    )( DEV_HANDLE hDevice, uint32_t *piNumDataStreams );
                GC_API_P(PDevGetDataStreamID      )( DEV_HANDLE hDevice, uint32_t iIndex, char *sDataStreamID, size_t *piSize );
                GC_API_P(PDevOpenDataStream       )( DEV_HANDLE hDevice, const char *sDataStreamID, DS_HANDLE *phDataStream );
                GC_API_P(PDevGetInfo              )( DEV_HANDLE hDevice, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API_P(PDevClose                )( DEV_HANDLE hDevice );
            
                GC_API_P(PDSAnnounceBuffer        )( DS_HANDLE hDataStream, void *pBuffer, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer );
                GC_API_P(PDSAllocAndAnnounceBuffer)( DS_HANDLE hDataStream, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer );
                GC_API_P(PDSFlushQueue            )( DS_HANDLE hDataStream, ACQ_QUEUE_TYPE iOperation );
                GC_API_P(PDSStartAcquisition      )( DS_HANDLE hDataStream, ACQ_START_FLAGS iStartFlags, uint64_t iNumToAcquire );
                GC_API_P(PDSStopAcquisition       )( DS_HANDLE hDataStream, ACQ_STOP_FLAGS iStopFlags );
                GC_API_P(PDSGetInfo               )( DS_HANDLE hDataStream, STREAM_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API_P(PDSGetBufferID           )( DS_HANDLE hDataStream, uint32_t iIndex, BUFFER_HANDLE *phBuffer );
                GC_API_P(PDSClose                 )( DS_HANDLE hDataStream );
                GC_API_P(PDSRevokeBuffer          )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, void **pBuffer, void **pPrivate );
                GC_API_P(PDSQueueBuffer           )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer );
                GC_API_P(PDSGetBufferInfo         )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, BUFFER_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
            
                /* GenTL v1.1 */
                GC_API_P(PGCGetNumPortURLs        )( PORT_HANDLE hPort, uint32_t *iNumURLs );
                GC_API_P(PGCGetPortURLInfo        )( PORT_HANDLE hPort, uint32_t iURLIndex, URL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API_P(PGCReadPortStacked       )( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries );
                GC_API_P(PGCWritePortStacked      )( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries );
            
                /* GenTL v1.3 */
                GC_API_P(PDSGetBufferChunkData    )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, SINGLE_CHUNK_DATA *pChunkData, size_t *piNumChunks );
            
                /* GenTL v1.4 */
                GC_API_P(PIFGetParentTL           )( IF_HANDLE hIface, TL_HANDLE *phSystem ); 
                GC_API_P(PDevGetParentIF          )( DEV_HANDLE hDevice, IF_HANDLE *phIface );
                GC_API_P(PDSGetParentDev          )( DS_HANDLE hDataStream, DEV_HANDLE *phDevice );
            
                /* GenTL v1.5 */
                GC_API_P(PDSGetNumBufferParts     )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t *piNumParts );
                GC_API_P(PDSGetBufferPartInfo     )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t iPartIndex, BUFFER_PART_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
            
                /* GenTL v1.6 */
                GC_API_P(PDSAnnounceCompositeBuffer)( DS_HANDLE hDataStream, size_t iNumSegments, void **ppSegments, size_t *piSizes, void *pPrivate, BUFFER_HANDLE *phBuffer );
                GC_API_P(PDSGetBufferInfoStacked  )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, DS_BUFFER_INFO_STACKED *pInfoStacked, size_t iNumInfos );
                GC_API_P(PDSGetBufferPartInfoStacked)( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, DS_BUFFER_PART_INFO_STACKED *pInfoStacked, size_t iNumInfos );
                GC_API_P(PDSGetNumFlows           )( DS_HANDLE hDataStream, uint32_t *piNumFlows );
                GC_API_P(PDSGetFlowInfo           )( DS_HANDLE hDataStream, uint32_t iFlowIndex, FLOW_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
                GC_API_P(PDSGetNumBufferSegments  )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t *piNumSegments );
                GC_API_P(PDSGetBufferSegmentInfo  )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t iSegmentIndex, SEGMENT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
            #ifdef __cplusplus
              } /* end of namespace GenTL */
            } /* end of extern "C" */
            #endif
            #endif /* GC_TLI_CLIENT_H_ */
            





            -
            Edité par VincentL10 13 avril 2021 à 9:19:12

            • Partager sur Facebook
            • Partager sur Twitter
              13 avril 2021 à 10:12:29

              Bon, on voit potentiellement une grosse connerie ligne 57. C'est plus des C/C++ "hardeux" que des personnes férues d'interopérabilité.

              Ca explique quelques problèmes que vous subissez.

              >Une nouvelle version est sortie.

              Vue les petites erreurs d'étourderies que j'ai eu l'impression de voir, je vous conseille vivement de passer rapidement sur cette nouvelle version, dans l'espoir qu'elle les corrige.

              C'est juste remplacer le contenu des répertoires de la librairie par les fichiers de la nouvelle version, après tout.

              Votre seules adhérences, c'est l'existence de <GC.h> et les 2 répertoires racines.

              Pour les LNK2019, il faudrait que vous compariez les différences entre ce que cherche le linker (le nom dans le message d'erreur) et ce qui est vraiment contenu dans le .lib (via DUMPBIN, par exemple).

              Après, avec la déclaration qui existe dans l'un des .h, on pourra corriger le tir (si la nouvelle version ne le fait pas encore).

              Petite liste des horreurs :

              https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk2019?view=msvc-160

              Pour les "LNK4272", vous devez encore avoir des réglages qui ciblent du x64 et non du x86, mais on pourra faire cela après.

              >Entre autre le GTL

              Ce la semble être un include "chapeau" pour une API C et non C++ d'une Dll qui semble utiliser les mêmes noms que <GC.h>.

              Il y a des chances que c'est soit l'une soit l'autre.

              L'API C est plus "rudimentaire" qu'une API C++ mais pose potentiellement moins de problème d'interopérabilité.

              Après, si ce qui vous intéresse est dans l'API C, il y a des chances que cela aussi disponible dans l'API C++, non ?

              Utiliser l'API C serait plus direct pour l'implémentation d'un wrapper mais il faudra faire un travail de "Design Objet" pour la rendre plus pratique à utiliser côté C#.

              Sinon, on parle bien de :

              https://github.com/roboception/rc_genicam_api

              Si oui, y lire attentivement la documentation.

              • Partager sur Facebook
              • Partager sur Twitter
              Je recherche un CDI/CDD/mission freelance comme Architecte Logiciel/ Expert Technique sur technologies Microsoft.
                13 avril 2021 à 10:30:41

                Pour la nouvelle version, n'étant pas beaucoup avancer, j'ai changer les dossiers avec le plus récent.

                Pour le dumpbin, je ne sais pas quelle lib demandé, car il ne précice pas laquelle est-ce, est ce qu'il demande ( ne correspond à aucune). Je vais les faire une par une.

                >Si oui, y lire attentivement la documentation.

                Oui, il s'agit bien de ca, je vais regarder

                • Partager sur Facebook
                • Partager sur Twitter
                  13 avril 2021 à 10:38:41

                  Dans le readme.md :

                  NOTE: For using the libraries in own projects, define the symbol GENICAM_NO_AUTO_IMPLIB in your project file to avoid linker problems with the GenICam libraries.

                  • Partager sur Facebook
                  • Partager sur Twitter
                  Je recherche un CDI/CDD/mission freelance comme Architecte Logiciel/ Expert Technique sur technologies Microsoft.
                    13 avril 2021 à 10:46:42

                    J'ai trouvé en cherchant dans le dossier fourni, un dossier symbols/Win64_x64 qui contient des fichiers pdb, dois-je les inclure dans le projet ? (Propriétés -> Débugage)

                    -
                    Edité par VincentL10 13 avril 2021 à 11:14:20

                    • Partager sur Facebook
                    • Partager sur Twitter
                      13 avril 2021 à 12:41:21

                      Les fichiers pdb peuvent être utile si vous cherchez à déboguer mais on en n'est pas encore là, et Win64_x64, c'est normalement du x64 pas x86, donc ça serait pas les bons si vous êtes toujours en x86.

                      Je sais pas qui vous fourni les fichiers, mais ça semble pas très "carré".

                      En ajoutant la constante de compilation "GENICAM_NO_AUTO_IMPLIB", ça règle pas les problèmes d'édition de lien ?

                      • Partager sur Facebook
                      • Partager sur Twitter
                      Je recherche un CDI/CDD/mission freelance comme Architecte Logiciel/ Expert Technique sur technologies Microsoft.
                        13 avril 2021 à 12:53:38

                        Le dossier télécharger ne comporte que le Win32_i86 et les Win64_x64 pour les fichiers sous Windows, je peux coder en x64 si besoins (il compile sans erreur).

                        Les fichier viennent du site EMVA.org, https://www.emva.org/standards-technology/genicam/

                        Sous quelle écriture dois-je l'ajouter? j'ai essayé avec un #define et un const char. (Désolé si cela semble très bête).

                        • Partager sur Facebook
                        • Partager sur Twitter
                          13 avril 2021 à 16:56:04

                          >Win32_i86 et les Win64_x64 pour les fichiers sous Windows

                          Ce qui représente la très grande majorité des plateformes Windows installables (manque que les plateforme ARM depuis que DEC Alpha n'est plus supporté).

                          >je peux coder en x64 si besoins (il compile sans erreur).

                          Vue la pré-prépondérance de ce type de plateforme et que .NET peut swicher de l'une à l'autre mais que les Dll sont tanquée dans une seule de ces plateforme ; Je vous conseille d'utiliser les versions x64 (si vous devez supporter les plateformes x86 (ou i86 32bits quoi), il serait préférable de n'avoir qu'une version x86 et de verrouiller l'assembly .NET au 32 bits). L'idéal serait d'avoir 2 jeux de versions (x86, x64) des Wrappers et 2 jeux de versions .NET (une 32bits Only et une 64 bits Only).

                          >Sous quelle écriture dois-je l'ajouter? j'ai essayé avec un #define

                          C'est fonction du type d'outils/chaîne de compilation et de comment a été conçu la gestion des configurations.

                          Donc un "#define" c'est pas si mal, mais c'est généralement encore plus "simple".

                          Allez dans "Propriétés du Projet"->"C/C++"->"Préprocesseur", à droite, il doit avoir une ligne "Définitions de préprocesseur", ajoutez-y GENICAM_NO_AUTO_IMPLIB (sans oublier les ; pour le séparer des autres constantes de compilation).

                          N.B.: Ajoutez cette constante à toutes les configurations et toutes les plateformes cibles.

                          • Partager sur Facebook
                          • Partager sur Twitter
                          Je recherche un CDI/CDD/mission freelance comme Architecte Logiciel/ Expert Technique sur technologies Microsoft.
                            13 avril 2021 à 17:28:39

                            J'ai ajouter la commande GENICAM_NO_AUTO_IMPLIB, et les erreurs restent les mêmes.:euh: 

                            https://documentation.euresys.com/Products/Coaxlink/Coaxlink_10_2/Content/04_Using_EGrabber/Programmer_Guide.htm

                            J'ai recherché, j'ai l'impression que la plupart passe par le biais d'un autre logiciel tiers pour y avoir accès plus facilement.

                            -
                            Edité par VincentL10 13 avril 2021 à 17:30:22

                            • Partager sur Facebook
                            • Partager sur Twitter
                              13 avril 2021 à 17:50:00

                              Si votre cible c'est des Coaxlink, il est indiqué qu'ils fournissent des assemblies .NET pour accéder à leur matos, alors pourquoi ce faire chier avec les Dll Natives ??? (j'ai pas tous lu :-°)

                              • Partager sur Facebook
                              • Partager sur Twitter
                              Je recherche un CDI/CDD/mission freelance comme Architecte Logiciel/ Expert Technique sur technologies Microsoft.
                                14 avril 2021 à 8:57:14

                                Je n'ai pas de cible précise, j'avais trouvé ce si qui décomposait le code pour l'écrire et c'est pas le premier, tous ceux que j'ai vu utilise quelque chose pour lié tous au programme mais ils ne le font jamais seul. C'était juste une trouvaille pour l'écriture.

                                J'ai l'impression que je n'ai pas accès à tout (à certains headers et aux dll)

                                -
                                Edité par VincentL10 14 avril 2021 à 8:58:39

                                • Partager sur Facebook
                                • Partager sur Twitter
                                  14 avril 2021 à 12:01:28

                                  >tous ceux que j'ai vu utilise quelque chose pour lié tous au programme mais ils ne le font jamais seul.

                                  Pouvez-vous être plus précis, SVP ?

                                  De ce que j'ai lu dans vos documents "Euresys", cela me conforte sur leur approche, car je suis tout à fait d'accord sur les remarques qu'ils donnent sur les implémentations de "référence".

                                  Si vous pouvez vous servir de leurs composants .NET dans le cadre de votre projet, je pense que cela pourrait être très bien. Mais vous pouvez toujours vous inspirer de leur conception pour faire vos wrapper dans le cas contraire.

                                  Quel est le lien entre GenAPI d'EMVA et "https://github.com/roboception/rc_genicam_api" ?

                                  C'est quoi vos éléments de base ? EMVA ou rc_genical_api ?

                                  Quel est votre latitude dans le choix des composants "socles" de votre projet ? C'est quoi votre cahier des charges en terme de composants "socles" ?

                                  Moi, je suis plus sur une stratégie de prendre le composant "socle" le plus proche de ma cible, pour minimiser le travail, tout en faisant gaffe aux licences d'utilisations (licences MIT, c'est génial).

                                  >J'ai l'impression que je n'ai pas accès à tout (à certains headers et aux dll)

                                  S'il y a des headers "inaccessibles", c'est vraisemblablement qu'il y a des raisons, donc n'essayez pas de les insérer aux forceps. S'il y a de bonnes raisons d'y avoir accès, c'est souvent via des constantes de compilation sémantiquement "cohérentes" qu'on obtient leur "accès".

                                  Pouvez-vous donc être factuelle sur les éléments de base (EMVA ou rc_genical_api) et sur les erreurs actuelles ?

                                  • Partager sur Facebook
                                  • Partager sur Twitter
                                  Je recherche un CDI/CDD/mission freelance comme Architecte Logiciel/ Expert Technique sur technologies Microsoft.
                                    14 avril 2021 à 12:25:49

                                    >Pouvez-vous être plus précis, SVP ?

                                    La plupart utilise des SDK pour développer plus facilement leur programme.

                                    >Si vous pouvez vous servir de leurs composants .NET dans le cadre de votre projet, je pense que cela pourrait être très bien. Mais vous pouvez toujours vous inspirer de leur conception pour faire vos wrapper dans le cas contraire.

                                    Oui, je ne suis pas partie sur Euresys mais sur Spinnaker, (une documentation et des exemples plus simple). Et suis en train de regarder comment ils font pour m'y inspirer.

                                    >Quel est le lien entre GenAPI d'EMVA et "https://github.com/roboception/rc_genicam_api" ?

                                    Les fichiers ne sont pas les mêmes (Et j'ai du mal à m'y retrouver avec celui de GitHub)

                                    >C'est quoi vos éléments de base ? EMVA ou rc_genical_api ?

                                    Je regarde EMVA

                                    >Quel est votre latitude dans le choix des composants "socles" de votre projet ?

                                    Je dois coder avec le protocole fournir par EMVA.

                                    >S'il y a des headers "inaccessibles", c'est vraisemblablement qu'il y a des raisons,

                                    C'est ce que je me suis dis, mais cela complique le travaille

                                    >Pouvez-vous donc être factuelle sur les éléments de base (EMVA ou rc_genical_api) et sur les erreurs actuelles ?

                                    Je travaille par rapport à EMVA

                                    En release, x64, aucune erreur

                                    En release, x86, 

                                    Gravité	Code	Description	Projet	Fichier	Ligne	État de la suppression
                                    Erreur	LNK2019	symbole externe non résolu "public: __thiscall GenICam_3_3::gcstring::gcstring(void)" (??0gcstring@GenICam_3_3@@QAE@XZ) référencé dans la fonction "public: __thiscall GenApi_3_3::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams>::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams>(class GenApi_3_3::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams> const &)" (??0?$CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi_3_3@@@GenApi_3_3@@QAE@ABV01@@Z)	WrapperCpp	WrapperCpp.obj	1	
                                    Erreur	LNK2019	symbole externe non résolu "public: class GenICam_3_3::gcstring & __thiscall GenICam_3_3::gcstring::operator=(class GenICam_3_3::gcstring const &)" (??4gcstring@GenICam_3_3@@QAEAAV01@ABV01@@Z) référencé dans la fonction "public: __thiscall GenApi_3_3::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams>::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams>(class GenApi_3_3::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams> const &)" (??0?$CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi_3_3@@@GenApi_3_3@@QAE@ABV01@@Z)	WrapperCpp	WrapperCpp.obj	1	
                                    Erreur	LNK2019	symbole externe non résolu "public: virtual __thiscall GenICam_3_3::gcstring::~gcstring(void)" (??1gcstring@GenICam_3_3@@UAE@XZ) référencé dans la fonction __unwindfunclet$??0?$CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi_3_3@@@GenApi_3_3@@QAE@ABV01@@Z$0	WrapperCpp	WrapperCpp.obj	1	
                                    Erreur	LNK2019	symbole externe non résolu "public: __thiscall GenApi_3_3::CNodeMapFactory::CNodeMapFactory(void)" (??0CNodeMapFactory@GenApi_3_3@@QAE@XZ) référencé dans la fonction "public: virtual void __thiscall GenApi_3_3::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams>::_GetSupportedSchemaVersions(class GenICam_3_3::gcstring_vector &)const " (?_GetSupportedSchemaVersions@?$CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi_3_3@@@GenApi_3_3@@UBEXAAVgcstring_vector@GenICam_3_3@@@Z)	WrapperCpp	WrapperCpp.obj	1	
                                    Erreur	LNK2019	symbole externe non résolu "public: void __thiscall GenApi_3_3::CNodeMapFactory::GetSupportedSchemaVersions(class GenICam_3_3::gcstring_vector &)const " (?GetSupportedSchemaVersions@CNodeMapFactory@GenApi_3_3@@QBEXAAVgcstring_vector@GenICam_3_3@@@Z) référencé dans la fonction "public: virtual void __thiscall GenApi_3_3::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams>::_GetSupportedSchemaVersions(class GenICam_3_3::gcstring_vector &)const " (?_GetSupportedSchemaVersions@?$CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi_3_3@@@GenApi_3_3@@UBEXAAVgcstring_vector@GenICam_3_3@@@Z)	WrapperCpp	WrapperCpp.obj	1	
                                    Erreur	LNK2019	symbole externe non résolu "public: virtual __thiscall GenApi_3_3::CNodeMapFactory::~CNodeMapFactory(void)" (??1CNodeMapFactory@GenApi_3_3@@UAE@XZ) référencé dans la fonction "public: virtual void __thiscall GenApi_3_3::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams>::_GetSupportedSchemaVersions(class GenICam_3_3::gcstring_vector &)const " (?_GetSupportedSchemaVersions@?$CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi_3_3@@@GenApi_3_3@@UBEXAAVgcstring_vector@GenICam_3_3@@@Z)	WrapperCpp	WrapperCpp.obj	1	
                                    Erreur	LNK2001	symbole externe non résolu "public: virtual __thiscall GenICam_3_3::AccessException::~AccessException(void)" (??1AccessException@GenICam_3_3@@UAE@XZ)	WrapperCpp	WrapperCpp.obj	1	
                                    Erreur	LNK2001	symbole externe non résolu "public: __thiscall GenICam_3_3::AccessException::AccessException(class GenICam_3_3::AccessException const &)" (??0AccessException@GenICam_3_3@@QAE@ABV01@@Z)	WrapperCpp	WrapperCpp.obj	1	
                                    Erreur	LNK2001	symbole externe non résolu "public: __thiscall GenICam_3_3::GenericException::GenericException(class GenICam_3_3::GenericException const &)" (??0GenericException@GenICam_3_3@@QAE@ABV01@@Z)	WrapperCpp	WrapperCpp.obj	1	
                                    Erreur	LNK2019	symbole externe non résolu "public: __thiscall GenICam_3_3::gcstring::gcstring(char const *)" (??0gcstring@GenICam_3_3@@QAE@PBD@Z) référencé dans la fonction "private: void __thiscall GenApi_3_3::CNodeMapRefT<class GenApi_3_3::CGeneric_XMLLoaderParams>::Release(void)" (?Release@?$CNodeMapRefT@VCGeneric_XMLLoaderParams@GenApi_3_3@@@GenApi_3_3@@AAEXXZ)	WrapperCpp	WrapperCpp.obj	1	
                                    Erreur	LNK2019	symbole externe non résolu "public: __thiscall GenICam_3_3::AccessException::AccessException(char const *,char const *,int,char const *)" (??0AccessException@GenICam_3_3@@QAE@PBD0H0@Z) référencé dans la fonction "public: class GenICam_3_3::AccessException __cdecl GenICam_3_3::ExceptionReporter<class GenICam_3_3::AccessException>::Report(char const *,...)" (?Report@?$ExceptionReporter@VAccessException@GenICam_3_3@@@GenICam_3_3@@QAA?AVAccessException@2@PBDZZ)	WrapperCpp	WrapperCpp.obj	1	
                                    Avertissement	LNK4272	type d'ordinateur bibliothèque 'x64' en conflit avec le type d'ordinateur cible 'x86'	WrapperCpp	GCBase_MD_VC141_v3_3.lib	1	
                                    Avertissement	LNK4272	type d'ordinateur bibliothèque 'x64' en conflit avec le type d'ordinateur cible 'x86'	WrapperCpp	GenApi_MD_VC141_v3_3.lib	1	
                                    Erreur	LNK1120	11 externes non résolus	WrapperCpp	WrapperCpp.dll	1	
                                    • Partager sur Facebook
                                    • Partager sur Twitter
                                      14 avril 2021 à 14:21:19

                                      Ok, comme je vous l'ai déjà dit, vous devriez vous concentrez d'abord sur les versions x64.

                                      Pour le warning LNK4272, la traduction française n'a aucun sens. Je pense que les .lib que l'éditeur de lien trouvent sont des versions 64 bits et pas 32 bits.

                                      J'ai peut-être été induit en erreur par la localisation des messages d'erreurs, si c'est bien les mêmes fichiers qu'avant.

                                      Si vous avez des versions 32bits et 64bits des .lib, mais dans des répertoires différents, il faut changer le point 3 pour qu'il soit différent en fonction de la plateforme cible.

                                      Mais si la version x64 compile, vous devriez commencer l'implémentation de vos wrappers dans ce contexte. Il est très peu probable que le passage au 32 bits posera problème pour vos wrappers qui devraient être assez simple d'un point de vue C++, donc facilement "portables".

                                      • Partager sur Facebook
                                      • Partager sur Twitter
                                      Je recherche un CDI/CDD/mission freelance comme Architecte Logiciel/ Expert Technique sur technologies Microsoft.
                                        14 avril 2021 à 16:54:35

                                        J'arrive à wrapper des fonctions simples (constante) pour l'instant et étudie les SDKs trouvé pour voir leurs fonctionnements
                                        • Partager sur Facebook
                                        • Partager sur Twitter
                                          30 avril 2021 à 12:04:15

                                          Bonjour, j'ai étudié le SDK trouvé et modifié pour l'adapter. Maintenant j'essaye de ressortir les fonctions pour ensuite les wrappers.

                                          J'ai besoin de sortir ces fonctions:

                                          void Connect(Port port, string name);
                                          void Connect(Port port);
                                          INode GetNode<INode>(string name);
                                          void InvalidateNodes();
                                          void Poll(long elapsedTime);
                                            

                                          A partir de son en-tête d'origine:

                                          /*!
                                          \file
                                          \brief  Definition of interface INodeMap
                                          \ingroup GenApi_PublicInterface
                                          */
                                          
                                          #ifndef GENAPI_INODEMAP_H
                                          #define GENAPI_INODEMAP_H
                                          
                                          #include <Base/GCBase.h>
                                          #include <GenApi/INode.h>
                                          #include <GenApi/IPort.h>
                                          #include <GenApi/IPortStacked.h>
                                          #include <GenApi/Synch.h>
                                          #include <GenApi/ConcatenatedWrite.h>
                                          
                                          #ifdef _MSC_VER
                                          #   pragma warning ( push )
                                          #   pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
                                          #endif
                                          
                                          namespace GENAPI_NAMESPACE
                                          {
                                          
                                              //*************************************************************
                                              // INodeMap interface
                                              //*************************************************************
                                          
                                              /**
                                              \brief Interface to access the node map
                                              \ingroup GenApi_PublicInterface
                                              */
                                              GENICAM_INTERFACE GENAPI_DECL_ABSTRACT INodeMap
                                              {
                                                  //! Retrieves all nodes in the node map
                                                  virtual void GetNodes(NodeList_t &Nodes) const =  0;
                                          
                                                  //! Retrieves the node from the central map by Name
                                                  virtual INode* GetNode( const GENICAM_NAMESPACE::gcstring& Name) const = 0;
                                          
                                                  //! Invalidates all nodes
                                                  virtual void InvalidateNodes() const =  0;
                                          
                                                  //! Connects a port to a port node with given name
                                                  virtual bool Connect( IPort* pPort, const GENICAM_NAMESPACE::gcstring& PortName) const = 0;
                                          
                                                  //! Connects a port to the standard port "Device"
                                                  virtual bool Connect( IPort* pPort) const = 0;
                                          
                                                  //! Connects a port to a port node with given name
                                                  virtual bool Connect(IPortStacked* pPort, const GENICAM_NAMESPACE::gcstring& PortName) = 0;
                                          
                                                  //! Connects a port to the standard port "Device"
                                                  virtual bool Connect(IPortStacked* pPort) = 0;
                                          
                                                  //! Get device name
                                                  /*! The device name identifies a device instance, e.g. for debugging purposes.
                                                  The default ist "Device". */
                                                  virtual GENICAM_NAMESPACE::gcstring GetDeviceName() = 0;
                                          
                                                  //! Fires nodes which have a polling time
                                                  virtual void Poll( int64_t ElapsedTime ) = 0;
                                          
                                                  //! Returns the lock which guards the node map
                                                  virtual CLock& GetLock() const = 0;
                                          
                                                  //! Get the number of nodes in the map
                                                  virtual uint64_t GetNumNodes() const  = 0;
                                          
                                                  //! Parse all Swissknife equations
                                                  virtual bool ParseSwissKnifes( GENICAM_NAMESPACE::gcstring_vector *pErrorList = NULL ) const = 0;
                                          
                                                  //! Create a new write concatenator object
                                                  virtual CNodeWriteConcatenator *NewNodeWriteConcatenator() const = 0;
                                          
                                                  //! Execute the transaction
                                                  virtual bool ConcatenatedWrite(CNodeWriteConcatenator *, bool featureStreaming = true, GENICAM_NAMESPACE::gcstring_vector *pErrorList = NULL) = 0;
                                          
                                              };
                                          }
                                          
                                          #ifdef _MSC_VER
                                          #   pragma warning ( pop )
                                          #endif
                                          
                                          #endif // ifndef GENAPI_INODEMAP_H
                                          

                                          J'ai beau essayé de toutes les manières possibles, il me manque un truc pour y réussir.

                                          Pourriez-vous m'aider s'il vous plait ?

                                          Merci d'avance

                                          • Partager sur Facebook
                                          • Partager sur Twitter
                                            30 avril 2021 à 20:50:48

                                            Pourquoi ne pas faire exactement la même interface ?

                                            Montrez votre code.

                                            EDIT :

                                            >le SDK trouvé et modifié pour l'adapter.

                                            Je suis assez circonspect.

                                            -
                                            Edité par bacelar 30 avril 2021 à 20:51:58

                                            • Partager sur Facebook
                                            • Partager sur Twitter
                                            Je recherche un CDI/CDD/mission freelance comme Architecte Logiciel/ Expert Technique sur technologies Microsoft.
                                              18 mai 2021 à 10:42:38

                                              J'essaye de refaire ma propre interface si possible, d'une part pour comprendre comment cela marche et d'autre part, pour en faire une nouvelle.

                                              Je viens de vérifier et je n'ai pas de code, juste mes includes. J'essaye de récupérer les interfaces pour les renommer et les rendre disponible en C#.

                                              • Partager sur Facebook
                                              • Partager sur Twitter
                                                18 mai 2021 à 15:40:10

                                                >d'une part pour comprendre comment cela marche et d'autre part, pour en faire une nouvelle.

                                                OK, mais quand on commence à faire du vélo, on commence avec des roulettes sur les cotés. ;)

                                                Votre classe INodeMap semble un peu trop C++ "standard" que C++/CLI (des pointeurs nus C++ comme paramètre de fonctions, etc...).

                                                C'est quoi 'GENICAM_INTERFACE GENAPI_DECL_ABSTRACT" ?

                                                Vous devriez faire en sorte que vos classes et méthodes des wrappers soient facilement utilisables en C# et dans les autres langages .NET, donc pas de pointeurs C++ mais plutôt des références .NET dans les signatures de méthodes.

                                                Donc à l'arrache :

                                                #ifndef GENAPI_Wrapper_INODEMAP_H
                                                #define GENAPI_Wrapper_INODEMAP_H
                                                 
                                                #include <Base/GCBase.h>
                                                #include <GenApi/INode.h>
                                                #include <GenApi/IPort.h>
                                                #include <GenApi/IPortStacked.h>
                                                #include <GenApi/Synch.h>
                                                #include <GenApi/ConcatenatedWrite.h>
                                                 
                                                #ifdef _MSC_VER
                                                #   pragma warning ( push )
                                                #   pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
                                                #endif
                                                
                                                #define GENAPI_NAMESPACE_Wrappers GENAPI_NAMESPACE::Wrappers
                                                
                                                namespace GENAPI_NAMESPACE_Wrappers
                                                {
                                                 
                                                    //*************************************************************
                                                    // INodeMap interface
                                                    //*************************************************************
                                                    class INodeMap
                                                    {
                                                        private GENAPI_NAMESPACE.NodeMap* pimp;
                                                
                                                        public Collection<INode^> GetNodes(){return ConvertNativeCollectionOfNodesToCollectionOfNodeWrapper(pimp->GetNodes());}
                                                 
                                                        public INode^ GetNode(string^ name){ return .... pimp->GetNode(....(name));};
                                                
                                                        public void InvalidateNodes(pimp->InvalidateNodes;);
                                                 
                                                        public Boolean Connect( IPort^ pPort, string^ portName)
                                                 
                                                        public Boolean Connect( IPort^ pPort){ return ...};
                                                 
                                                        public Boolean Connect(IPortStacked^ pPort, string portName){ return ....pimp->....};
                                                 
                                                        public Boolean Connect(IPortStacked^ pPort){ return ....pimp->....};
                                                 
                                                        public string GetDeviceName(){ return ....pimp->....};
                                                 
                                                        public void Poll( long elapsedTime ){ return ....pimp->....};
                                                 
                                                        public CLock^ GetLock(){ return ....pimp->....};
                                                 
                                                        public System::Int64 GetNumNodes(){ return ....pimp->....};;
                                                 
                                                        public Boolean ParseSwissKnifes(string errorList = NULL ){ return ....pimp->....};
                                                 
                                                        public CNodeWriteConcatenator^ NewNodeWriteConcatenator(){ return ....pimp->....};
                                                 
                                                        public Boolean ConcatenatedWrite(CNodeWriteConcatenator^ gen, Boolean featureStreaming = true,  string errorList = NULL) = 0;
                                                 
                                                        public static INodeMap CreateNodeMap(GENAPI_NAMESPACE.NodeMap* imp_){ pimp = imp_);
                                                    };
                                                }
                                                 
                                                #ifdef _MSC_VER
                                                #   pragma warning ( pop )
                                                #endif
                                                 
                                                #endif // ifndef GENAPI_Wrapper_INODEMAP_H



                                                • Partager sur Facebook
                                                • Partager sur Twitter
                                                Je recherche un CDI/CDD/mission freelance comme Architecte Logiciel/ Expert Technique sur technologies Microsoft.
                                                  31 mai 2021 à 10:13:12

                                                  Tout d'abord : 'GENICAM_INTERFACE GENAPI_DECL_ABSTRACT' correspond, à ce que j'ai vu, à l'importation et exportation des dll.


                                                  Merci pour votre morceau de code, à ce que j'ai compris vous créer des objets pour avoir accès aux méthodes ? (Pour être sur d'avoir compris et non réutiliser cela bêtement).

                                                  • Partager sur Facebook
                                                  • Partager sur Twitter
                                                    31 mai 2021 à 11:29:01

                                                    >correspond, à ce que j'ai vu, à l'importation et exportation des dll.

                                                    Ouais, c'est clairement pas la méthode habituelle de faire ce genre de chose. Vérifiez les valeurs effectives de ces MACROs pour s'assurer que cela n'implique pas des incompatibilités avec .NET (conventions d'appels en particulier). (si vous avez des difficultés à trouver les valeurs effectives de ces MACROs : https://docs.microsoft.com/fr-fr/cpp/build/reference/p-preprocess-to-a-file?view=msvc-160

                                                    Comme je vous l'ai déjà indiqué, il serait bien plus efficace d'avoir une API .NET qui "mimique" l'API C++ fournie.

                                                    Dans mon code, il semble que j'ai fait ce raccourci : "même API".

                                                    Dans ce cas, le seul travail du wrapper, c'est de carrosser l'API C++ Native pour n'utiliser que les types/concepts facilement utilisable en .NET. J'utilise la technique du Pimpl pour "automatiser" ce carrossage :

                                                    https://en.cppreference.com/w/cpp/language/pimpl

                                                    La manière d'obtenir l'objet "Natif" qu'on doit carrosser, elle est fonction de votre API Native. Moi, je ne fais que vous indiquez comment devrait être une API ".NET compatible", et pour introduire l'objet à carrosser dans ce wrapper, il suffit d'appeler la méthode statique "CreateNodeMap" en fournissant votre objet "Natif" en paramètre et elle vous retourne sa carrosserie .NET.

                                                    Si l'API Native n'est pas la même/similaire que l'API .NET (que vous avez conçu ?), vous aurez bien plus de travail dans les méthodes (et la classe de wrapping au total) pour faire le job. Ce n'est plus un simple wrapper mais plutôt un bridge (Cf. le Design Pattern de même nom).

                                                    • Partager sur Facebook
                                                    • Partager sur Twitter
                                                    Je recherche un CDI/CDD/mission freelance comme Architecte Logiciel/ Expert Technique sur technologies Microsoft.
                                                      31 mai 2021 à 12:58:57

                                                      Au sujet de la MACRO, j'ai cherché les valeurs effectives, je n'est que trouvé sa définition: "NDebug".

                                                      Je ne possède que les fichiers .h du sdk et quelques exemples en C++ et C#. Je me suis appuyé sur le programme C# pour essayé de recréer avec mes fonctions, leur dll dont je n'ai pas accès.

                                                      Ce que j'aimerais, dans un premier temps, c'est de recréer leur bibliothèques avec mes en-tête pour obtenir les même fonctions pour que leur programme en C# marche avec ma dll.

                                                      Merci pour ces différentes méthodes, je vais essayer de les utiliser.

                                                      • Partager sur Facebook
                                                      • Partager sur Twitter
                                                        31 mai 2021 à 14:05:49

                                                        >"NDebug"

                                                        ???

                                                        C'est pas plutôt NDEBUG qui correspond à un marqueur "Release" sous MSVC ???

                                                        Cela n'a pas grand-chose à voir avec de l'import/export d'API de Dll.

                                                        Utilisez l'option de compilation "/P" de MSVC, comme je vous l'ai déjà indiqué dans mon précédent message, à la place de vous prendre la tête à déterminer "à la main" les valeurs effectives des MACRO.

                                                        Je ne comprends plus grand-chose à votre situation. Si vous avez accès au SDK, vous avez accès aux fichiers d'en-tête (.h) ET aux Dll.

                                                        Si vous avez du code C#, c'est que soit vous avez des assemblies .NET dans les Dll du SDK, soit que l'API C++ est suffisamment "gentille" pour être appelée en "P/Invoque" ou "IJW" (It Just Work). Donc, dans les 2 cas, pas/plus besoin de wrappers.

                                                        Pouvez-vous nous donner des extraits de .h et .cs qui vous servent d'inspiration ?

                                                        • Partager sur Facebook
                                                        • Partager sur Twitter
                                                        Je recherche un CDI/CDD/mission freelance comme Architecte Logiciel/ Expert Technique sur technologies Microsoft.
                                                          31 mai 2021 à 14:24:02

                                                          Je viens de mettre le /p  pour "Prétraiter dans un fichier".

                                                          using System;
                                                          using System.IO;
                                                          using System.Collections.Generic;
                                                          using SpinNET;
                                                          using SpinNET.GenApi;
                                                          
                                                          namespace Acquisition_CSharp
                                                          {
                                                              class Program
                                                              {
                                                          
                                                          #if DEBUG
                                                                  // Disables heartbeat on GEV cameras so debugging does not incur timeout errors
                                                                  static int DisableHeartbeat(IManagedCamera cam, INodeMap nodeMap, INodeMap nodeMapTLDevice)
                                                                  {
                                                                      Console.WriteLine("Checking device type to see if we need to disable the camera's heartbeat...\n\n");
                                                          
                                                                      IEnum iDeviceType = nodeMapTLDevice.GetNode<IEnum>("DeviceType");
                                                                      IEnumEntry iDeviceTypeGEV = iDeviceType.GetEntryByName("GigEVision");
                                                                      // We first need to confirm that we're working with a GEV camera
                                                                      if (iDeviceType != null && iDeviceType.IsReadable)
                                                                      {
                                                                          if (iDeviceType.Value == iDeviceTypeGEV.Value)
                                                                          {
                                                                              Console.WriteLine(
                                                                                  "Working with a GigE camera. Attempting to disable heartbeat before continuing...\n\n");
                                                                              IBool iGEVHeartbeatDisable = nodeMap.GetNode<IBool>("GevGVCPHeartbeatDisable");
                                                                              if (iGEVHeartbeatDisable == null || !iGEVHeartbeatDisable.IsWritable)
                                                                              {
                                                                                  Console.WriteLine(
                                                                                      "Unable to disable heartbeat on camera. Continuing with execution as this may be non-fatal...");
                                                                              }
                                                                              else
                                                                              {
                                                                                  iGEVHeartbeatDisable.Value = true;
                                                                                  Console.WriteLine("WARNING: Heartbeat on GigE camera disabled for the rest of Debug Mode.");
                                                                                  Console.WriteLine(
                                                                                      "         Power cycle camera when done debugging to re-enable the heartbeat...");
                                                                              }
                                                                          }
                                                                          else
                                                                          {
                                                                              Console.WriteLine("Camera does not use GigE interface. Resuming normal execution...\n\n");
                                                                          }
                                                                      }
                                                                      else
                                                                      {
                                                                          Console.WriteLine("Unable to access TL device nodemap. Aborting...");
                                                                          return -1;
                                                                      }
                                                          
                                                                      return 0;
                                                                  }
                                                          #endif
                                                                  // This function acquires and saves 10 images from a device.
                                                                  static int AcquireImages(IManagedCamera cam, INodeMap nodeMap, INodeMap nodeMapTLDevice)
                                                                  {
                                                                      int result = 0;
                                                          
                                                                      Console.WriteLine("\n*** IMAGE ACQUISITION ***\n");
                                                          
                                                                      try
                                                                      {
                                                                          IEnum iAcquisitionMode = nodeMap.GetNode<IEnum>("AcquisitionMode");
                                                                          if (iAcquisitionMode == null || !iAcquisitionMode.IsWritable)
                                                                          {
                                                                              Console.WriteLine("Unable to set acquisition mode to continuous (node retrieval). Aborting...\n");
                                                                              return -1;
                                                                          }
                                                          
                                                                          // Retrieve entry node from enumeration node
                                                                          IEnumEntry iAcquisitionModeContinuous = iAcquisitionMode.GetEntryByName("Continuous");
                                                                          if (iAcquisitionModeContinuous == null || !iAcquisitionMode.IsReadable)
                                                                          {
                                                                              Console.WriteLine(
                                                                                  "Unable to set acquisition mode to continuous (enum entry retrieval). Aborting...\n");
                                                                              return -1;
                                                                          }
                                                          
                                                                          // Set symbolic from entry node as new value for enumeration node
                                                                          iAcquisitionMode.Value = iAcquisitionModeContinuous.Symbolic;
                                                          
                                                                          Console.WriteLine("Acquisition mode set to continuous...");
                                                          
                                                          #if DEBUG
                                                                          Console.WriteLine("\n\n*** DEBUG ***\n\n");
                                                                          // If using a GEV camera and debugging, should disable heartbeat first to prevent further issues
                                                          
                                                                          if (DisableHeartbeat(cam, nodeMap, nodeMapTLDevice) != 0)
                                                                          {
                                                                              return -1;
                                                                          }
                                                          
                                                                          Console.WriteLine("\n\n*** END OF DEBUG ***\n\n");
                                                          #endif
                                                                          
                                                                          cam.BeginAcquisition();
                                                          
                                                                          Console.WriteLine("Acquiring images...");
                                                          
                                                                          String deviceSerialNumber = "";
                                                          
                                                                          IString iDeviceSerialNumber = nodeMapTLDevice.GetNode<IString>("DeviceSerialNumber");
                                                                          if (iDeviceSerialNumber != null && iDeviceSerialNumber.IsReadable)
                                                                          {
                                                                              deviceSerialNumber = iDeviceSerialNumber.Value;
                                                          
                                                                              Console.WriteLine("Device serial number retrieved as {0}...", deviceSerialNumber);
                                                                          }
                                                                          Console.WriteLine();
                                                          
                                                                          // Retrieve, convert, and save images
                                                                          const int NumImages = 10;
                                                          
                                                                          for (int imageCnt = 0; imageCnt < NumImages; imageCnt++)
                                                                          {
                                                                              try
                                                                              {
                                                                                
                                                                                  using(IManagedImage rawImage = cam.GetNextImage(1000))
                                                                                  {
                                                                                      
                                                                                      if (rawImage.IsIncomplete)
                                                                                      {
                                                                                          Console.WriteLine("Image incomplete with image status {0}...", rawImage.ImageStatus);
                                                                                      }
                                                                                      else
                                                                                      {
                                                                                          
                                                                                          uint width = rawImage.Width;
                                                          
                                                                                          uint height = rawImage.Height;
                                                          
                                                                                          Console.WriteLine(
                                                                                              "Grabbed image {0}, width = {1}, height = {2}", imageCnt, width, height);
                                                          
                                                                                        
                                                                                          using(IManagedImage convertedImage = rawImage.Convert(PixelFormatEnums.Mono8))
                                                                                          {
                                                                                              // Create a unique filename
                                                                                              String filename = "Acquisition-CSharp-";
                                                                                              if (deviceSerialNumber != "")
                                                                                              {
                                                                                                  filename = filename + deviceSerialNumber + "-";
                                                                                              }
                                                                                              filename = filename + imageCnt + ".jpg";
                                                          
                                                                                            
                                                                                              convertedImage.Save(filename);
                                                          
                                                                                              Console.WriteLine("Image saved at {0}\n", filename);
                                                                                          }
                                                                                      }
                                                                                  }
                                                                              }
                                                                              catch (SpinException ex)
                                                                              {
                                                                                  Console.WriteLine("Error: {0}", ex.Message);
                                                                                  result = -1;
                                                                              }
                                                                          }
                                                          
                                                                          cam.EndAcquisition();
                                                                      }
                                                                      catch (SpinException ex)
                                                                      {
                                                                          Console.WriteLine("Error: {0}", ex.Message);
                                                                          result = -1;
                                                                      }
                                                                     
                                                                      return result;
                                                                  }
                                                          
                                                                  static int PrintDeviceInfo(INodeMap nodeMap)
                                                                  {
                                                                      int result = 0;
                                                          
                                                                      try
                                                                      {
                                                                          Console.WriteLine("\n*** DEVICE INFORMATION ***\n");
                                                          
                                                                          ICategory category = nodeMap.GetNode<ICategory>("DeviceInformation");
                                                                          if (category != null && category.IsReadable)
                                                                          {
                                                                              for (int i = 0; i < category.Children.Length; i++)
                                                                              {
                                                                                  Console.WriteLine(
                                                                                      "{0}: {1}",
                                                                                      category.Children[i].Name,
                                                                                      (category.Children[i].IsReadable ? category.Children[i].ToString()
                                                                                       : "Node not available"));
                                                                              }
                                                                              Console.WriteLine();
                                                                          }
                                                                          else
                                                                          {
                                                                              Console.WriteLine("Device control information not available.");
                                                                          }
                                                                      }
                                                                      catch (SpinException ex)
                                                                      {
                                                                          Console.WriteLine("Error: {0}", ex.Message);
                                                                          result = -1;
                                                                      }
                                                          
                                                                      return result;
                                                                  }
                                                          
                                                                  int RunSingleCamera(IManagedCamera cam)
                                                                  {
                                                                      int result = 0;
                                                          
                                                                      try
                                                                      {
                                                                          // Retrieve TL device nodemap and print device information
                                                                          INodeMap nodeMapTLDevice = cam.GetTLDeviceNodeMap();
                                                          
                                                                          result = PrintDeviceInfo(nodeMapTLDevice);
                                                          
                                                                          // Initialize camera
                                                                          cam.Init();
                                                          
                                                                          // Retrieve GenICam nodemap
                                                                          INodeMap nodeMap = cam.GetNodeMap();
                                                          
                                                                          // Acquire images
                                                                          result = result | AcquireImages(cam, nodeMap, nodeMapTLDevice);
                                                          
                                                                          // Deinitialize camera
                                                                          cam.DeInit();
                                                                      }
                                                                      catch (SpinException ex)
                                                                      {
                                                                          Console.WriteLine("Error: {0}", ex.Message);
                                                                          result = -1;
                                                                      }
                                                          
                                                                      return result;
                                                                  }
                                                          
                                                                  // Example entry point; please see Enumeration_CSharp example for more
                                                                  // in-depth comments on preparing and cleaning up the system.
                                                                  static int Main(string[] args)
                                                                  {
                                                                      int result = 0;
                                                          
                                                                      Program program = new Program();
                                                          
                                                                   
                                                                      FileStream fileStream;
                                                                      try
                                                                      {
                                                                          fileStream = new FileStream(@"test.txt", FileMode.Create);
                                                                          fileStream.Close();
                                                                          File.Delete("test.txt");
                                                                      }
                                                                      catch
                                                                      {
                                                                          Console.WriteLine("Failed to create file in current folder. Please check permissions.");
                                                                          Console.WriteLine("Press enter to exit...");
                                                                          Console.ReadLine();
                                                                          return -1;
                                                                      }
                                                          
                                                                      // Retrieve singleton reference to system object
                                                                      ManagedSystem system = new ManagedSystem();
                                                          
                                                                      // Print out current library version
                                                                      LibraryVersion spinVersion = system.GetLibraryVersion();
                                                                      Console.WriteLine(
                                                                          "Spin library version: {0}.{1}.{2}.{3}\n\n",
                                                                          spinVersion.major,
                                                                          spinVersion.minor,
                                                                          spinVersion.type,
                                                                          spinVersion.build);
                                                          
                                                                      // Retrieve list of cameras from the system
                                                                      ManagedCameraList camList = system.GetCameras();
                                                          
                                                                      Console.WriteLine("Number of cameras detected: {0}\n\n", camList.Count);
                                                          
                                                                      // Finish if there are no cameras
                                                                      if (camList.Count == 0)
                                                                      {
                                                                          // Clear camera list before releasing system
                                                                          camList.Clear();
                                                          
                                                                          // Release system
                                                                          system.Dispose();
                                                          
                                                                          Console.WriteLine("Not enough cameras!");
                                                                          Console.WriteLine("Done! Press Enter to exit...");
                                                                          Console.ReadLine();
                                                          
                                                                          return -1;
                                                                      }
                                                          
                                                                      int index = 0;
                                                          
                                                                      foreach(IManagedCamera managedCamera in camList) using(managedCamera)
                                                                      {
                                                                          Console.WriteLine("Running example for camera {0}...", index);
                                                          
                                                                          try
                                                                          {
                                                                              // Run example
                                                                              result = result | program.RunSingleCamera(managedCamera);
                                                                          }
                                                                          catch (SpinException ex)
                                                                          {
                                                                              Console.WriteLine("Error: {0}", ex.Message);
                                                                              result = -1;
                                                                          }
                                                          
                                                                          Console.WriteLine("Camera {0} example complete...\n", index++);
                                                                      }
                                                          
                                                                      // Clear camera list before releasing system
                                                                      camList.Clear();
                                                          
                                                                      // Release system
                                                                      system.Dispose();
                                                          
                                                                      Console.WriteLine("\nDone! Press Enter to exit...");
                                                                      Console.ReadLine();
                                                          
                                                                      return result;
                                                                  }
                                                              }
                                                          }
                                                          
                                                          

                                                          Voici le programme C#, le seul élément extérieur est la dll nommer "SpinNET" (je ne connais pas son code source, mais cela comprend toutes les fonctions)

                                                          -
                                                          Edité par VincentL10 31 mai 2021 à 14:25:15

                                                          • Partager sur Facebook
                                                          • Partager sur Twitter
                                                            31 mai 2021 à 17:14:46

                                                            Attention à enlever l'option "/P" après avoir déterminer les valeurs effectives des MACRO car cette option peut bloquer la suite de la génération des livrables.

                                                            Le code C# est assez mal adroit, trahissant un programmeur C/hardeux qu'un programmeur habitué à .NET et la programmation Objet/avec exception.

                                                            Évitez les int en valeur de retour pour une gestion des erreurs qui sent bon les années 70. Évitez aussi les #if.../#endif. Utilisez l'instruction "using" plutôt que ces "try/catch/x.Clear/x.Close" boiteux (comme c'est utilisé ligne 138 mais malheureusement pas ailleurs).

                                                            Il y a peut-être des faiblesses aussi dans la librairie/assembly SpinNET comme la méthode "Init" ligne 221 ou "DeInit" ligne 230. Mais un wrapper peut facilement corriger ces faiblesses.

                                                            Si vous disposez de l'assembly SpinNet, pourquoi s'enquiquiner à faire des wrappers .NET ???

                                                            >je ne connais pas son code source

                                                            A moins que l'assembly ne soit "obfusqué", récupérer un code source ce fait très facilement par l'un des nombreux dé-compilateurs .NET (Refector, etc...). Et pour avoir juste des signatures, un petit coup de ILDASM pour avoir la liste des choses exportées fait largement l'affaire.(Pas besoin de lire le code IL. ;-) )

                                                            Comme c'est un sujet qui dure un peu dans le temps, il doit avoir des détails que je n'ai plus en tête car ; si votre objectif est d'avoir la même API que SpinNET pourquoi ne pas directement utiliser SpinNET ? Si vous voulez "améliorer" SpinNET, pourquoi ne pas faire un bridge qui encapsule SpinNET ?

                                                            Ce bridge n'a pas à utiliser du C++ car cela serait un bridge .NET<->.NET (100% .NET).

                                                            • Partager sur Facebook
                                                            • Partager sur Twitter
                                                            Je recherche un CDI/CDD/mission freelance comme Architecte Logiciel/ Expert Technique sur technologies Microsoft.
                                                              31 mai 2021 à 17:36:37

                                                              J'ai déjà essayé avec des dé-compilateurs mais il ne me trouve rien (je vais en essayer d'autres alors).

                                                              Mon objectif est d'une part de comprendre le code et d'autre part de "le mettre à jour".

                                                              Je possède une en-tête qui regroupe (si j'ai bien regardé) toutes les autres en-têtes. Si je compile juste en incluant dans le .cpp, le nom de l'en-tête, serait-il possible de retrouver leurs fonctions en C# (pour moi oui, mais une confirmation me rassurerai) ?

                                                              • Partager sur Facebook
                                                              • Partager sur Twitter

                                                              Problème de DLL

                                                              × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
                                                              × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
                                                              • Editeur
                                                              • Markdown