void ptr of VB

J

JC

Hi

I am tring to compile the AMR decoder from 3gpp as lib and use it in dotnet
VB.

However, I don't know how to import the following function to my vb.

void *Decoder_Interface_init( void );
void Decoder_Interface_exit( void *state );
void Decoder_Interface_Decode( void *st, short *bits, short *synth, int
bfi );

I know that I need to import by following code

<DllImport("AMR_decoder.dll")> _
'sth func name
End Sub

However, I don't know how to convert the C func to VB func.

Do anyone of you can teach me to do so?

Thx

JC
 
D

Dragon

Hi JC,

The closest representation of void* is IntPtr.
You may try the following:

~
Declare Function Decoder_Interface_init Lib "AMR_decoder.dll" ( _
) As IntPtr

Declare Sub Decoder_Interface_exit Lib "AMR_decoder.dll" ( _
ByVal state As IntPtr _
)

Declare Sub Decoder_Interface_Decode Lib "AMR_decoder.dll" ( _
ByVal st As IntPtr, _
ByRef bits As Short, _
ByRef synth As Short, _
ByVal bfi As Integer _
)
~

I typed it directly in newsreader, so watch out for typos.

HTH,
Roman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top