如何使用CComSafeArray获取SAFEARRAY数据

时间:2018-10-04 08:23:24

标签: visual-c++ com

我不知道为什么下面的命令“ HRESULT hr = cElement.Attach(* saData);”不工作。我喜欢将学习应用于检索“ SAFEARRAY”定义的大数据。谢谢。

Ping pingSender = new Ping ();

// Create a buffer of 32 bytes of data to be transmitted.
string data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
byte[] buffer = Encoding.ASCII.GetBytes (data);

// Wait 10 seconds for a reply.
int timeout = 10000;

// Set options for transmission:
// The data can go through 255 gateways or routers
// before it is destroyed, and the data packet
// cannot be fragmented.
PingOptions options = new PingOptions (255, true);

// Send the request.
PingReply reply = pingSender.Send(IPAddress.Text, timeout, buffer, options);

0 个答案:

没有答案