tecsun

study .net

博客园 首页 新随笔 联系 订阅 管理

利用ATL (BCB #include <atl/atlbase.h>)
BSTR->LPSTR  
  BSTR   word;  
  USES_CONVERSION;  
  OLE2A(word);  
   
  char*   ->   BSTR  
  char   buf[10];  
  BSTR   word;  
  USES_CONVERSION;  
  word   =   SysAllocString(A2W(buf)); 
或(不用ATL)
char * ->BSTR
wchar_t buf[4]={char1,char2,char3};
BSTR   word= SysAllocString(buf);
posted on 2008-04-14 09:35  tecsun  阅读(2473)  评论(0)    收藏  举报