convert eVC++ prototype to VB.NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eric BOUXIROT

    convert eVC++ prototype to VB.NET

    hi,

    i must convert all of these eVC++ prototypes to use with VB.NET....

    DLLEXPORT long F_BDO_MessageBo xOK(char *IN_title, char *IN_msg );
    DLLEXPORT long F_BDO_MessageBo xOUINON(char *IN_title, char *IN_msg );
    DLLEXPORT long F_BDO_CalculAXp lusB(short int *IN_Tab_entree ,int IN_taille
    ,
    double *OUT_Tab_sortie _freq ,
    double *OUT_Tab_sortie , double IN_A,
    double IN_B, double IN_Te, double OUT_Elt_max[2],
    double OUT_Elt_min[2] );
    DLLEXPORT long F_BDO_determine _A_et_B(int IN_Point1[2] ,int IN_Point2[2] ,
    double *OUT_A, double *OUT_B );
    DLLEXPORT long F_BDO_trouve_ma ximum(short int *IN_Tab_entree ,int IN_taille
    ,
    short int IN_seuil, double IN_A,
    double IN_B, int *OUT_n_max,
    double *OUT_y_max );
    DLLEXPORT long F_BDO_trouve_ma x_et_min(double *IN_Tab_entree ,int IN_taille
    ,
    double *OUT_max, double *OUT_min);
    DLLEXPORT long F_BDO_conv_line aire_dbl(double *IN_Tab_entree, int IN_taille,
    double *OUT_Tab_sortie );
    DLLEXPORT long F_BDO_conv_dbl_ dba(double *IN_Tab_entree, int IN_taille,
    double *OUT_Tab_sortie );
    DLLEXPORT long F_BDO_conv_dbl_ dba_bf(double *IN_Tab_entree, double
    *IN_Tab_freq,
    int IN_taille,doubl e *OUT_Tab_sortie );
    DLLEXPORT long F_BDO_trouver_i ndice_harmoniqu e_roue(double
    *IN_Tab_entree, double *IN_Tab_freq,
    int IN_taille,doubl e freq_theorique,
    double seuil_freq,doub le seuil_ampl,
    unsigned short int *OUT_Tab_ind_ha rmonique);
    DLLEXPORT char F_BDO_init(void );
    DLLEXPORT void F_BDO_close(voi d);
    DLLEXPORT char F_BDO_start(voi d);
    DLLEXPORT char F_BDO_stop(void );
    DLLEXPORT char F_BDO_getSample (char *pBuf,long *cbDone);

    what rules i can apply to correctly convert datas type parameters ?

    thank a lot ...


  • Alex Feinman [MVP]

    #2
    Re: convert eVC++ prototype to VB.NET

    Almost straightforward .

    The only catches here are:
    long becomes Int32 (or Integer)
    char* needs to be passed as Byte() and you will have to convert strings
    manually by using Encoding.ASCII. GetBytes(myStri ng + Chr(0))
    double* is Double()
    short int * is Int16()
    double cannot be passed down at all. you can only pass it ByRef and your c++
    function will need to be modified or a wrapper written around it.
    char as return value stays Char (or Byte can be used)

    --
    Alex Feinman
    ---
    Visit http://www.opennetcf.org
    "Eric BOUXIROT" <rickou@rickou. net> wrote in message
    news:41494dd4$0 $12042$626a14ce @news.free.fr.. .[color=blue]
    > hi,
    >
    > i must convert all of these eVC++ prototypes to use with VB.NET....
    >
    > DLLEXPORT long F_BDO_MessageBo xOK(char *IN_title, char *IN_msg );
    > DLLEXPORT long F_BDO_MessageBo xOUINON(char *IN_title, char *IN_msg );
    > DLLEXPORT long F_BDO_CalculAXp lusB(short int *IN_Tab_entree ,int IN_taille
    > ,
    > double *OUT_Tab_sortie _freq ,
    > double *OUT_Tab_sortie , double IN_A,
    > double IN_B, double IN_Te, double OUT_Elt_max[2],
    > double OUT_Elt_min[2] );
    > DLLEXPORT long F_BDO_determine _A_et_B(int IN_Point1[2] ,int IN_Point2[2]
    > ,
    > double *OUT_A, double *OUT_B );
    > DLLEXPORT long F_BDO_trouve_ma ximum(short int *IN_Tab_entree ,int
    > IN_taille ,
    > short int IN_seuil, double IN_A,
    > double IN_B, int *OUT_n_max,
    > double *OUT_y_max );
    > DLLEXPORT long F_BDO_trouve_ma x_et_min(double *IN_Tab_entree ,int
    > IN_taille ,
    > double *OUT_max, double *OUT_min);
    > DLLEXPORT long F_BDO_conv_line aire_dbl(double *IN_Tab_entree, int
    > IN_taille,
    > double *OUT_Tab_sortie );
    > DLLEXPORT long F_BDO_conv_dbl_ dba(double *IN_Tab_entree, int IN_taille,
    > double *OUT_Tab_sortie );
    > DLLEXPORT long F_BDO_conv_dbl_ dba_bf(double *IN_Tab_entree, double
    > *IN_Tab_freq,
    > int IN_taille,doubl e *OUT_Tab_sortie );
    > DLLEXPORT long F_BDO_trouver_i ndice_harmoniqu e_roue(double
    > *IN_Tab_entree, double *IN_Tab_freq,
    > int IN_taille,doubl e freq_theorique,
    > double seuil_freq,doub le seuil_ampl,
    > unsigned short int *OUT_Tab_ind_ha rmonique);
    > DLLEXPORT char F_BDO_init(void );
    > DLLEXPORT void F_BDO_close(voi d);
    > DLLEXPORT char F_BDO_start(voi d);
    > DLLEXPORT char F_BDO_stop(void );
    > DLLEXPORT char F_BDO_getSample (char *pBuf,long *cbDone);
    >
    > what rules i can apply to correctly convert datas type parameters ?
    >
    > thank a lot ...
    >
    >[/color]


    Comment

    • Eric BOUXIROT

      #3
      Re: convert eVC++ prototype to VB.NET

      thank a lot but is there any software to automaticaly convert C API to
      VB.NET ?
      i have search with google without answer but...

      thanks

      "Alex Feinman [MVP]" <public_news@al exfeinman.com> a écrit dans le message
      de news: OLsdiQAnEHA.346 4@tk2msftngp13. phx.gbl...[color=blue]
      > Almost straightforward .
      >
      > The only catches here are:
      > long becomes Int32 (or Integer)
      > char* needs to be passed as Byte() and you will have to convert strings
      > manually by using Encoding.ASCII. GetBytes(myStri ng + Chr(0))
      > double* is Double()
      > short int * is Int16()
      > double cannot be passed down at all. you can only pass it ByRef and your
      > c++ function will need to be modified or a wrapper written around it.
      > char as return value stays Char (or Byte can be used)
      >
      > --
      > Alex Feinman
      > ---
      > Visit http://www.opennetcf.org
      > "Eric BOUXIROT" <rickou@rickou. net> wrote in message
      > news:41494dd4$0 $12042$626a14ce @news.free.fr.. .[color=green]
      >> hi,
      >>
      >> i must convert all of these eVC++ prototypes to use with VB.NET....
      >>
      >> DLLEXPORT long F_BDO_MessageBo xOK(char *IN_title, char *IN_msg );
      >> DLLEXPORT long F_BDO_MessageBo xOUINON(char *IN_title, char *IN_msg );
      >> DLLEXPORT long F_BDO_CalculAXp lusB(short int *IN_Tab_entree ,int
      >> IN_taille ,
      >> double *OUT_Tab_sortie _freq ,
      >> double *OUT_Tab_sortie , double IN_A,
      >> double IN_B, double IN_Te, double OUT_Elt_max[2],
      >> double OUT_Elt_min[2] );
      >> DLLEXPORT long F_BDO_determine _A_et_B(int IN_Point1[2] ,int IN_Point2[2]
      >> ,
      >> double *OUT_A, double *OUT_B );
      >> DLLEXPORT long F_BDO_trouve_ma ximum(short int *IN_Tab_entree ,int
      >> IN_taille ,
      >> short int IN_seuil, double IN_A,
      >> double IN_B, int *OUT_n_max,
      >> double *OUT_y_max );
      >> DLLEXPORT long F_BDO_trouve_ma x_et_min(double *IN_Tab_entree ,int
      >> IN_taille ,
      >> double *OUT_max, double *OUT_min);
      >> DLLEXPORT long F_BDO_conv_line aire_dbl(double *IN_Tab_entree, int
      >> IN_taille,
      >> double *OUT_Tab_sortie );
      >> DLLEXPORT long F_BDO_conv_dbl_ dba(double *IN_Tab_entree, int IN_taille,
      >> double *OUT_Tab_sortie );
      >> DLLEXPORT long F_BDO_conv_dbl_ dba_bf(double *IN_Tab_entree, double
      >> *IN_Tab_freq,
      >> int IN_taille,doubl e *OUT_Tab_sortie );
      >> DLLEXPORT long F_BDO_trouver_i ndice_harmoniqu e_roue(double
      >> *IN_Tab_entree, double *IN_Tab_freq,
      >> int IN_taille,doubl e freq_theorique,
      >> double seuil_freq,doub le seuil_ampl,
      >> unsigned short int *OUT_Tab_ind_ha rmonique);
      >> DLLEXPORT char F_BDO_init(void );
      >> DLLEXPORT void F_BDO_close(voi d);
      >> DLLEXPORT char F_BDO_start(voi d);
      >> DLLEXPORT char F_BDO_stop(void );
      >> DLLEXPORT char F_BDO_getSample (char *pBuf,long *cbDone);
      >>
      >> what rules i can apply to correctly convert datas type parameters ?
      >>
      >> thank a lot ...
      >>
      >>[/color]
      >
      >[/color]


      Comment

      • Neil Cowburn

        #4
        Re: convert eVC++ prototype to VB.NET

        Paul Yao has a tool for you to look at.




        "Eric BOUXIROT" <rickou@rickou. net> wrote in message
        news:4149bd58$0 $12051$626a14ce @news.free.fr.. .[color=blue]
        > thank a lot but is there any software to automaticaly convert C API to
        > VB.NET ?
        > i have search with google without answer but...
        >
        > thanks
        >
        > "Alex Feinman [MVP]" <public_news@al exfeinman.com> a écrit dans le message
        > de news: OLsdiQAnEHA.346 4@tk2msftngp13. phx.gbl...[color=green]
        >> Almost straightforward .
        >>
        >> The only catches here are:
        >> long becomes Int32 (or Integer)
        >> char* needs to be passed as Byte() and you will have to convert strings
        >> manually by using Encoding.ASCII. GetBytes(myStri ng + Chr(0))
        >> double* is Double()
        >> short int * is Int16()
        >> double cannot be passed down at all. you can only pass it ByRef and your
        >> c++ function will need to be modified or a wrapper written around it.
        >> char as return value stays Char (or Byte can be used)
        >>
        >> --
        >> Alex Feinman
        >> ---
        >> Visit http://www.opennetcf.org
        >> "Eric BOUXIROT" <rickou@rickou. net> wrote in message
        >> news:41494dd4$0 $12042$626a14ce @news.free.fr.. .[color=darkred]
        >>> hi,
        >>>
        >>> i must convert all of these eVC++ prototypes to use with VB.NET....
        >>>
        >>> DLLEXPORT long F_BDO_MessageBo xOK(char *IN_title, char *IN_msg );
        >>> DLLEXPORT long F_BDO_MessageBo xOUINON(char *IN_title, char *IN_msg );
        >>> DLLEXPORT long F_BDO_CalculAXp lusB(short int *IN_Tab_entree ,int
        >>> IN_taille ,
        >>> double *OUT_Tab_sortie _freq ,
        >>> double *OUT_Tab_sortie , double IN_A,
        >>> double IN_B, double IN_Te, double OUT_Elt_max[2],
        >>> double OUT_Elt_min[2] );
        >>> DLLEXPORT long F_BDO_determine _A_et_B(int IN_Point1[2] ,int IN_Point2[2]
        >>> ,
        >>> double *OUT_A, double *OUT_B );
        >>> DLLEXPORT long F_BDO_trouve_ma ximum(short int *IN_Tab_entree ,int
        >>> IN_taille ,
        >>> short int IN_seuil, double IN_A,
        >>> double IN_B, int *OUT_n_max,
        >>> double *OUT_y_max );
        >>> DLLEXPORT long F_BDO_trouve_ma x_et_min(double *IN_Tab_entree ,int
        >>> IN_taille ,
        >>> double *OUT_max, double *OUT_min);
        >>> DLLEXPORT long F_BDO_conv_line aire_dbl(double *IN_Tab_entree, int
        >>> IN_taille,
        >>> double *OUT_Tab_sortie );
        >>> DLLEXPORT long F_BDO_conv_dbl_ dba(double *IN_Tab_entree, int IN_taille,
        >>> double *OUT_Tab_sortie );
        >>> DLLEXPORT long F_BDO_conv_dbl_ dba_bf(double *IN_Tab_entree, double
        >>> *IN_Tab_freq,
        >>> int IN_taille,doubl e *OUT_Tab_sortie );
        >>> DLLEXPORT long F_BDO_trouver_i ndice_harmoniqu e_roue(double
        >>> *IN_Tab_entree, double *IN_Tab_freq,
        >>> int IN_taille,doubl e freq_theorique,
        >>> double seuil_freq,doub le seuil_ampl,
        >>> unsigned short int *OUT_Tab_ind_ha rmonique);
        >>> DLLEXPORT char F_BDO_init(void );
        >>> DLLEXPORT void F_BDO_close(voi d);
        >>> DLLEXPORT char F_BDO_start(voi d);
        >>> DLLEXPORT char F_BDO_stop(void );
        >>> DLLEXPORT char F_BDO_getSample (char *pBuf,long *cbDone);
        >>>
        >>> what rules i can apply to correctly convert datas type parameters ?
        >>>
        >>> thank a lot ...
        >>>
        >>>[/color]
        >>
        >>[/color]
        >
        >[/color]


        Comment

        Working...