不行吧..........
万一图像中有 00 出现怎么办? 
字符串cc的内容可能有错   还有 要delete[] cc;吧

解决方案 »

  1.   

    错,ConvertStringToBSTR在转化二进制数据会出问题
    而且,你根本就不需要char to BSTR
    直接
    SysAllocStringByteLen(NULL,you_len);
    CopyMemory(s_flag,cc,you_len);
    注意看msdn的对第一个参数为空的解释
    If psz is Null, a string of the requested length is allocated, but not initialized. The string psz can contain embedded null characters, and does not need to end with a Null. Free the returned string later with SysFreeString.
      

  2.   

    你不要想用什么new char ,delete一类的来传递
    这种方法在dll中有用,应为地址都在同一内存空间中
    要是进程间呢,或者不同机器间呢,搞个屁啊