How to convert char * to BSTR?

后端 未结 5 1291
滥情空心
滥情空心 2020-12-03 01:51

How can I pass a char * from C dll to VB

Here is sample code:

void Cfunc(char *buffer,int len)
{
  BSTR buf_bstr = SysAllocString((BSTR)buffer);
  V         


        
5条回答
  •  一生所求
    2020-12-03 02:09

    instead of char* array,try _tchar* array.Because Sysallocstring takes only the Unicode characters in a 32 bit application.

提交回复
热议问题