一个关于com很菜的问题,高手救命
李V四 2002-07-29 09:03:31 STDMETHODIMP CGNetDog::readnetdog(BSTR *bstrname)
{
// TODO: Add your implementation code here
DWORD dwReturnCode;
char pIResult[200];
NetDogAddr=0; // Starting address to read.
NetDogBytes=200;// Number of bytes to read.
if(NetDogBytes>=200) NetDogBytes=200;
memset(pIResult,0,200);
NetDogData=pIResult; // Buffer to store date from Netdog.
dwReturnCode= NetDogRead();
bstrname=(_bstr_t)pIResult;********
return S_OK;
}
以上是我在com定义的一个函数想把char [200]转化成BSTR类型为什么不行