note 46281 added to faq.com
| From: | junk dot ghost at virgindOttnet | Date: | Tue, 05 Oct 2004 16:27:23 +0000 |
| Subject: | note 46281 added to faq.com | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78031@lists.php.net to get a copy of this message | ||
It may be obvious to everyone else but...
If you want to write your own COM DLL in MSVC++6 and you want to pass it a string, you need the
following in your .idl file:
HRESULT function_name([in] BSTR parameter_name,
[retval, out] BSTR * retval);
retval is the result of your function as a string to be passed back.
BSTR is an unsigned short *, so if you want to use your string with STL string etc. you may need to
convert parameters to and from char *.
The burden of my message is that from PHP
$comThing = new COM("comThing.comThing");
print $comThing->function_name("Jeremy");
Jeremy will be marshalled as wide chars, which match BSTR.
----
Manual Page -- http://www.php.net/manual/en/faq.com.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46281
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46281&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46281&report=yes
Search -- http://master.php.net/manage/user-notes.php