根据这篇文章来写了一下dll文件。
http://www.chinaddv.com/WebProgram/PHP/2007/12-20/11981385878753.html
发现在vc++中,生成dll文件时,会出错。主要代码:STDMETHODIMP Ctest::Encode(
   unsigned int msgType
   unsigned int msgLength,
   BSTR message,
   BSTR result
   )
{
// TODO: Add your implementation code here
BSTR temp = ::SysAllocString(L"中国人民解放军 NFS Soft");
*result = temp;
return S_OK;
}出错代码:E:\C\NFS\test.cpp(12) : error C2144: syntax error : missing ',' before type 'unsigned int'
E:\C\NFS\test.cpp(16) : error C2511: 'Encode' : overloaded member function 'long (unsigned int,unsigned int,unsigned short *,unsigned short *)' not found in 'Ctest'
        E:\C\NFS\test.h(10) : see declaration of 'Ctest'
Generating Code...