PC Review


Reply
Thread Tools Rate Thread

convert eVC++ prototype to VB.NET

 
 
Eric BOUXIROT
Guest
Posts: n/a
 
      16th Sep 2004
hi,

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

DLLEXPORT long F_BDO_MessageBoxOK(char *IN_title, char *IN_msg );
DLLEXPORT long F_BDO_MessageBoxOUINON(char *IN_title, char *IN_msg );
DLLEXPORT long F_BDO_CalculAXplusB(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_maximum(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_max_et_min(double *IN_Tab_entree ,int IN_taille
,
double *OUT_max, double *OUT_min);
DLLEXPORT long F_BDO_conv_lineaire_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,double *OUT_Tab_sortie);
DLLEXPORT long F_BDO_trouver_indice_harmonique_roue(double
*IN_Tab_entree,double *IN_Tab_freq,
int IN_taille,double freq_theorique,
double seuil_freq,double seuil_ampl,
unsigned short int *OUT_Tab_ind_harmonique);
DLLEXPORT char F_BDO_init(void);
DLLEXPORT void F_BDO_close(void);
DLLEXPORT char F_BDO_start(void);
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 ...


 
Reply With Quote
 
 
 
 
Alex Feinman [MVP]
Guest
Posts: n/a
 
      16th Sep 2004
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(myString + 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" <(E-Mail Removed)> wrote in message
news:41494dd4$0$12042$(E-Mail Removed)...
> hi,
>
> i must convert all of these eVC++ prototypes to use with VB.NET....
>
> DLLEXPORT long F_BDO_MessageBoxOK(char *IN_title, char *IN_msg );
> DLLEXPORT long F_BDO_MessageBoxOUINON(char *IN_title, char *IN_msg );
> DLLEXPORT long F_BDO_CalculAXplusB(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_maximum(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_max_et_min(double *IN_Tab_entree ,int
> IN_taille ,
> double *OUT_max, double *OUT_min);
> DLLEXPORT long F_BDO_conv_lineaire_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,double *OUT_Tab_sortie);
> DLLEXPORT long F_BDO_trouver_indice_harmonique_roue(double
> *IN_Tab_entree,double *IN_Tab_freq,
> int IN_taille,double freq_theorique,
> double seuil_freq,double seuil_ampl,
> unsigned short int *OUT_Tab_ind_harmonique);
> DLLEXPORT char F_BDO_init(void);
> DLLEXPORT void F_BDO_close(void);
> DLLEXPORT char F_BDO_start(void);
> 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 ...
>
>



 
Reply With Quote
 
Eric BOUXIROT
Guest
Posts: n/a
 
      16th Sep 2004
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]" <(E-Mail Removed)> a écrit dans le message
de news: (E-Mail Removed)...
> 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(myString + 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" <(E-Mail Removed)> wrote in message
> news:41494dd4$0$12042$(E-Mail Removed)...
>> hi,
>>
>> i must convert all of these eVC++ prototypes to use with VB.NET....
>>
>> DLLEXPORT long F_BDO_MessageBoxOK(char *IN_title, char *IN_msg );
>> DLLEXPORT long F_BDO_MessageBoxOUINON(char *IN_title, char *IN_msg );
>> DLLEXPORT long F_BDO_CalculAXplusB(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_maximum(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_max_et_min(double *IN_Tab_entree ,int
>> IN_taille ,
>> double *OUT_max, double *OUT_min);
>> DLLEXPORT long F_BDO_conv_lineaire_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,double *OUT_Tab_sortie);
>> DLLEXPORT long F_BDO_trouver_indice_harmonique_roue(double
>> *IN_Tab_entree,double *IN_Tab_freq,
>> int IN_taille,double freq_theorique,
>> double seuil_freq,double seuil_ampl,
>> unsigned short int *OUT_Tab_ind_harmonique);
>> DLLEXPORT char F_BDO_init(void);
>> DLLEXPORT void F_BDO_close(void);
>> DLLEXPORT char F_BDO_start(void);
>> 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 ...
>>
>>

>
>



 
Reply With Quote
 
Neil Cowburn
Guest
Posts: n/a
 
      16th Sep 2004
Paul Yao has a tool for you to look at.

http://www.paulyao.com/resources/tools/pinvoke.asp


"Eric BOUXIROT" <(E-Mail Removed)> wrote in message
news:4149bd58$0$12051$(E-Mail Removed)...
> 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]" <(E-Mail Removed)> a écrit dans le message
> de news: (E-Mail Removed)...
>> 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(myString + 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" <(E-Mail Removed)> wrote in message
>> news:41494dd4$0$12042$(E-Mail Removed)...
>>> hi,
>>>
>>> i must convert all of these eVC++ prototypes to use with VB.NET....
>>>
>>> DLLEXPORT long F_BDO_MessageBoxOK(char *IN_title, char *IN_msg );
>>> DLLEXPORT long F_BDO_MessageBoxOUINON(char *IN_title, char *IN_msg );
>>> DLLEXPORT long F_BDO_CalculAXplusB(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_maximum(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_max_et_min(double *IN_Tab_entree ,int
>>> IN_taille ,
>>> double *OUT_max, double *OUT_min);
>>> DLLEXPORT long F_BDO_conv_lineaire_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,double *OUT_Tab_sortie);
>>> DLLEXPORT long F_BDO_trouver_indice_harmonique_roue(double
>>> *IN_Tab_entree,double *IN_Tab_freq,
>>> int IN_taille,double freq_theorique,
>>> double seuil_freq,double seuil_ampl,
>>> unsigned short int *OUT_Tab_ind_harmonique);
>>> DLLEXPORT char F_BDO_init(void);
>>> DLLEXPORT void F_BDO_close(void);
>>> DLLEXPORT char F_BDO_start(void);
>>> 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 ...
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hacking around with a prototype Mike Labosh Microsoft Access 16 14th Jun 2006 10:38 PM
prototype zhangzhulin Microsoft Access 2 22nd Feb 2006 03:41 AM
C# prototype of C: void** frankh@terra.com.br Microsoft C# .NET 11 18th Aug 2005 12:06 AM
convert eVC++ prototype to VB.NET Eric BOUXIROT Microsoft VB .NET 3 16th Sep 2004 06:02 PM
vb prototype Eric Clapton Microsoft VB .NET 8 3rd Mar 2004 04:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:37 PM.