| Chrome 插件在处理输出的时候,如果是字符串,必须NPN_MemAlloc来分配一个内存 
            
              
                             DWORD dwNum = WideCharToMultiByte(CP_UTF8,NULL,rlt.bstrVal,-1,NULL,0,NULL,FALSE);              char *psText;              psText = new char[dwNum];              if(!psText)              {               delete []psText;              }              WideCharToMultiByte(CP_UTF8,NULL,rlt.bstrVal,-1,psText,dwNum,NULL,FALSE);                                        NPUTF8 *utf8_chars = static_cast<NPUTF8*>(NPN_MemAlloc(dwNum));              memcpy(utf8_chars, psText, dwNum);              STRINGZ_TO_NPVARIANT(utf8_chars, *result);                                          delete []psText;   | 右边部分 |