strings from vb to evc++...

E

Eric BOUXIROT

hi there,

i have som etrouble when i call a custom DLL (made with eVC++) ..my function
take char* (non unicode) to display it (after convert to unicode)

DLLEXPORT long F_BDO_MessageBoxOK(char *IN_title, char *IN_msg )

The declare is
Public Declare Function F_BDO_MessageBoxOK Lib "PDA_BDO.dll" (ByVal
IN_title() As Byte, ByVal IN_msg() As Byte) As Int32

I use this syntax in vb to call the DLL..
F_BDO_MessageBoxOK(ascii.GetBytes("toto"), ascii.GetBytes("tata"))

but it seem VB not add 0 char at the end of string....

how i can do except to add chr(0) after my string ?

thank a lot !
 
A

Alex Feinman [MVP]

When you use internal marshaller and pass a string as unicode, the string is
0-terminated. Since you need ascii (rarely used in Windows CE), and took
matters in your own hands, I guess it's up to you to 0-terminate the buffer
 

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