关键在于你如何使用结果.如果你处理过后的内容不是 STRING. 那么你用收没有什么用处.如果不作为string使用可以在VB侧使用SDK处理这些东西.
注意所有的POINTER都是LONG.

解决方案 »

  1.   

    http://www.csdn.net/expert/topic/706/706991.xml?temp=.438122
      

  2.   

    呵呵,找错地方了,VC专版
    对于VB的类型,不一定人人知道啊?
      

  3.   

    用VARIANT类型作返回值,用variant接收
      

  4.   

    BSTR decryptstr(LPCTSTR instr,LPCTSTR key)
    {
         USES_CONVERSION;    char keyi[9];
        DES des;
        int nLen=strleng((char*)instr);
        int nNewLen = (nLen+6)/8*8;
        strcpy(keyi,key);
        char* lpBuf = (char*)malloc(nNewLen+1);
        memset(lpBuf,'\0',nNewLen+1);
        memcpy(lpBuf,instr,nLen);
        des.decrypt (keyi,lpBuf,nNewLen/8);
        lpBuf[nNewLen]='\0';
        char* lp=new char[nNewLen+1];
        memset(lp,'\0',nNewLen+1);
        memcpy(lp,lpBuf,nNewLen);
        return SysAllocString(A2OLE(lp));
    }
      

  5.   

    up.if use com interface ,it's quite good. 
    but vb can not find a proper data type to receive BSTR. and free is also a big problem.anyway, to solve kyo1979 () 's problem, 
    use  similar99(迷路) method  , and at the same time, use COM IF instead of common DLL.