在VC中如何返回一个字节集?VB中如何申明?在VC中如何写一个函数,在VB中掉用格式如下(StrConv):
Dim abc() As Byte
abc = StrConv("ccc", vbFromUnicode)得到值: 
abc(0)=99
abc(1)=99
abc(2)=99VC中的函数该如何写?
???  WINAPI StrToBin(LPVOID lpbuffer)
{
//BYTE* Value = (BYTE*)lpbuffer;
return ??;
}我在VB申明如下:
Private Declare Function StrToBin Lib "abc.dll" (ByVal buffer As Any) As Byte()Dim abc() As Byte
abc = StrToBin("ccc")??为什么得不到值呢?

解决方案 »

  1.   

    extern "C" __declspec(export) long stdcall YourFunction(..)
      

  2.   

    你好,我的问题是:
    在VC中如何返回一个字节集?VB中如何申明?
    在VC中如何写一个函数,在VB中掉用格式如下(StrConv):
    Dim abc() As Byte
    abc = StrConv("ccc", vbFromUnicode)
    得到值: 
    abc(0)=99
    abc(1)=99
    abc(2)=99
     
    我想请教VC中的函数该如何写?
    ???  WINAPI StrToBin(LPVOID lpbuffer)
    {
    //BYTE* Value = (BYTE*)lpbuffer;
    return ??;
    }
    我在VB申明如下:
    Private Declare Function StrToBin Lib "abc.dll" (ByVal buffer As Any) As Byte()
    Dim abc() As Byte
    abc = StrToBin("ccc")
    ??为什么得不到值呢?
    我想模拟VB的StrConv函数,在VC中该如何写?谢谢.