关于c#:无法将参数1从\\’char [25]\\’转换为\\’SAFEARRAY *\\’ | 珊瑚贝

cannot convert parameter 1 from ‘char [25]’ to ‘SAFEARRAY *’


我的 c 代码中有一个 char sendBuf[sizeof(double)*3 + 1];。

我的 c# com 代码方法 Multicast( byte[] message) 将字节数组作为参数。

那么为什么调用 Multicast(sendBuf) 不抛出这个错误 cannot convert parameter 1 from ‘char [25]’ to ‘SAFEARRAY *’

不是 char 数组 c/c 中的字节数组

那么我该如何将此 char* 转换为 safearray 呢?

我试过了

1
2
3
4
5
SAFEARRAYBOUND bound[1] = {25, 0};
SAFEARRAY * psa = SafeArrayCreate(VT_UI1, 1, bound);

for(int i = 0; i <25; i++){
SafeArrayPutElement(psa, &i, sendBuf[i]);

但是为 SafeArrayPutElement

得到 cannot convert parameter 2 from ‘int *’ to ‘LONG *’


SAFEARRAY API 文档

从 SafeArrayCreateVector

开始


来源:https://www.codenong.com/9686544/

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_9710.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?