你要有时间可看看PHP手册上的com函数库Many COM objects expose their properties as arrays, or using array-style access. In PHP 4, you may use PHP array syntax to read/write such a property, but only a single dimension is allowed. If you want to read a multi-dimensional property, you could instead make the property access into a function call, with each parameter representing each dimension of the array access, but there is no way to write to such a property. PHP 5 introduces the following new features to make your life easier: Access multi-dimensional arrays, or COM properties that require multiple parameters using PHP array syntax. You can also write or set properties using this technique. Iterate SafeArrays ("true" arrays) using the the 节 called foreach 在 16 章 control structure. This works because SafeArrays include information about their size. If an array-style property implements IEnumVariant then you can also use foreach for that property too; take a look at the 节 called For Each for more information on this topic.
Access multi-dimensional arrays, or COM properties that require multiple parameters using PHP array syntax. You can also write or set properties using this technique. Iterate SafeArrays ("true" arrays) using the the 节 called foreach 在 16 章 control structure. This works because SafeArrays include information about their size. If an array-style property implements IEnumVariant then you can also use foreach for that property too; take a look at the 节 called For Each for more information on this topic.
另外,你再看看SAFEARRAY是如何构建的,向远程传递时是字符串,流,还是其他?可以去VC和VB版问一下
3KYOU..
楼主【caojapan】截止到2008-06-30 14:47:46的历史汇总数据(不包括此帖):
发帖数:11 发帖分:560
结贴数:5 结贴分:500
未结数:6 未结分:60
结贴率:45.45 % 结分率:89.29 %
楼主该结一些帖子了
现在,我发现了问题,因为我接收到的数据,在http://PHP中把\0做为字符串处理 了,但是我传入到COM中时,COM一解析\0就当成结束了,所以挂了..现在处理\0 后可以传入进去.也可以接收出来..
但问题又来出来了...我接收出来的数据现在是STRING类型,输出的时候要转为二进制,才能回传给调用的COM接口, 结果我发现我的PHP5.2.6这个版本,不支持GD,
我在每一个字符后面加上\0还原为二进制,结果,到是能让COM接收,但就是速度太慢,时间太长.. 而我想用imagecreatefromstring()却又不支持...晕死.
我从网上下载了一个php_gd2.dll放到了php5新建一个ext目录下,然后在php.ini中找到extension_dir这句改成下面的地址:extension_dir = "D:\usr\local\php5\ext\"再在,dynamic Extensions下面的;extension=msql.dll下面手工加入extension=php_gd2.dll (别人的都自己有,我的只有一个msql.dll,晕死.)
重启apache,可还是不支持GD...怎么办?
C里是将\0作为结整,PHP作为字符,要进行转码替换,好象要用到Pack