我在C++ Builder2010中參考了Winsock控制元件,其中得到資料的方法GetData的宣告如下:
void __fastcall TWinsock::GetData(VARIANT* data/*[in,out]*/, VARIANT type/*[in,opt]*/, VARIANT maxLen/*[in,opt]*/)
{
GetDefaultInterface()->GetData(data/*[in,out]*/, type/*[in,opt]*/, maxLen/*[in,opt]*/);
}
這里的type是什么引數?我的代碼如下:
void __fastcall TForm1::Winsock1DataArrival(TObject *Sender, long bytesTotal)
{
tagVARIANT RecBuff[10];
Winsock1->GetData((TVariant)&RecBuff ,(TVariant)&(0),(TVariant)&bytesTotal);
}
編譯后出現:Must take address of a memory location,我不知錯在哪里,有哪位高手能解答?在此先謝謝了!
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/154202.html
標籤:網絡及通訊開發
